https://bugs.webkit.org/show_bug.cgi?id=164858
Reviewed by Saam Barati.
Source/JavaScriptCore:
Allow importing the same module multiple times. Previously, when specifying the same
module in the <script type="module" src="here">, it throws TypeError.
* builtins/ModuleLoaderPrototype.js:
(requestFetch):
(requestTranslate):
(requestInstantiate):
(requestSatisfy):
LayoutTests:
* js/dom/modules/module-load-same-module-from-different-entry-point-in-src-expected.txt: Added.
* js/dom/modules/module-load-same-module-from-different-entry-point-in-src.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209172
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2016-11-30 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ [JSC] Specifying same module entry point multiple times cause TypeError
+ https://bugs.webkit.org/show_bug.cgi?id=164858
+
+ Reviewed by Saam Barati.
+
+ * js/dom/modules/module-load-same-module-from-different-entry-point-in-src-expected.txt: Added.
+ * js/dom/modules/module-load-same-module-from-different-entry-point-in-src.html: Added.
+
2016-11-30 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Add support for right-to-left layouts
--- /dev/null
+2 different module tag will attempt to load the same module with "src" attribute.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Module is not executed yet.
+PASS window.moduleExecutedCount is 0
+Executing module-load-same-module-from-different-entry-point.js.
+PASS window.moduleExecutedCount is 1
+PASS window.moduleExecutedCount is 1
+PASS counter is 2
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
--- /dev/null
+<!DOCTYPE HTML>
+<html>
+<head>
+<script src="../../../resources/js-test-pre.js"></script>
+</head>
+<body>
+<script>
+description('2 different module tag will attempt to load the same module with "src" attribute.');
+window.jsTestIsAsync = true;
+window.moduleExecutedCount = 0;
+debug('Module is not executed yet.');
+shouldBe(`window.moduleExecutedCount`, `0`);
+var counter = 0;
+function onLoad() {
+ shouldBe(`window.moduleExecutedCount`, `1`);
+ ++counter;
+}
+function finish() {
+ shouldBe(`counter`, `2`);
+ finishJSTest();
+}
+
+</script>
+<script src="../../../resources/js-test-post.js"></script>
+<script type="module" src="./script-tests/module-load-same-module-from-different-entry-point.js" onload="onLoad()"></script>
+<script type="module" src="./script-tests/module-load-same-module-from-different-entry-point.js" onload="onLoad()"></script>
+<script type="module">
+finish();
+</script>
+</body>
+</html>
2016-11-30 Yusuke Suzuki <utatane.tea@gmail.com>
+ [JSC] Specifying same module entry point multiple times cause TypeError
+ https://bugs.webkit.org/show_bug.cgi?id=164858
+
+ Reviewed by Saam Barati.
+
+ Allow importing the same module multiple times. Previously, when specifying the same
+ module in the <script type="module" src="here">, it throws TypeError.
+
+ * builtins/ModuleLoaderPrototype.js:
+ (requestFetch):
+ (requestTranslate):
+ (requestInstantiate):
+ (requestSatisfy):
+
+2016-11-30 Yusuke Suzuki <utatane.tea@gmail.com>
+
WebAssembly JS API: export a module namespace object instead of a module environment
https://bugs.webkit.org/show_bug.cgi?id=165121
"use strict";
var entry = this.ensureRegistered(key);
- if (entry.state > @ModuleLink) {
- var deferred = @newPromiseCapability(@InternalPromise);
- deferred.@reject.@call(@undefined, new @TypeError("Requested module is already ready to be executed."));
- return deferred.@promise;
- }
-
if (entry.fetch)
return entry.fetch;
"use strict";
var entry = this.ensureRegistered(key);
- if (entry.state > @ModuleLink) {
- var deferred = @newPromiseCapability(@InternalPromise);
- deferred.@reject.@call(@undefined, new @TypeError("Requested module is already ready to be executed."));
- return deferred.@promise;
- }
-
if (entry.translate)
return entry.translate;
"use strict";
var entry = this.ensureRegistered(key);
- if (entry.state > @ModuleLink) {
- var deferred = @newPromiseCapability(@InternalPromise);
- deferred.@reject.@call(@undefined, new @TypeError("Requested module is already ready to be executed."));
- return deferred.@promise;
- }
-
if (entry.instantiate)
return entry.instantiate;
"use strict";
var entry = this.ensureRegistered(key);
- if (entry.state > @ModuleLink) {
- var deferred = @newPromiseCapability(@InternalPromise);
- deferred.@reject.@call(@undefined, new @TypeError("Requested module is already ready to be executed."));
- return deferred.@promise;
- }
-
if (entry.satisfy)
return entry.satisfy;