<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[205613] releases/WebKitGTK/webkit-2.14/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/205613">205613</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2016-09-08 02:40:13 -0700 (Thu, 08 Sep 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/205278">r205278</a> - [JSC] Add initiator parameter to module pipeline
https://bugs.webkit.org/show_bug.cgi?id=161470
Reviewed by Saam Barati.
Source/JavaScriptCore:
The fetching semantics of the <script type="module"> tag has per module-tag context.
For example, "nonce", "crossorigin" etc. attributes are shared in the fetching requests
issued from the module-tag. To transfer this information, we add a new parameter "initiator"
to the module loader pipeline. We are planning to transfer information by this parameter.
At the same time, we also perform some clean up.
- Use arrow function in ModuleLoaderPrototype.js.
- Rename "ResolveDependencies" to "Satisfy" to align to the loader spec.
* builtins/ModuleLoaderPrototype.js:
(newRegistryEntry):
(commitInstantiated):
(requestFetch):
(requestTranslate):
(requestInstantiate):
(requestSatisfy):
(requestInstantiateAll):
(requestLink):
(moduleEvaluation):
(provide):
(loadAndEvaluateModule):
(requestResolveDependencies.): Deleted.
(requestResolveDependencies): Deleted.
(requestReady): Deleted.
(link): Deleted.
(loadModule): Deleted.
(linkAndEvaluateModule): Deleted.
* bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
* bytecode/BytecodeIntrinsicRegistry.h:
* jsc.cpp:
(GlobalObject::moduleLoaderResolve):
(GlobalObject::moduleLoaderFetch):
* runtime/Completion.cpp:
(JSC::loadAndEvaluateModule):
(JSC::loadModule):
(JSC::linkAndEvaluateModule):
* runtime/Completion.h:
* runtime/JSGlobalObject.h:
* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::loadAndEvaluateModule):
(JSC::JSModuleLoader::loadModule):
(JSC::JSModuleLoader::linkAndEvaluateModule):
(JSC::JSModuleLoader::resolve):
(JSC::JSModuleLoader::fetch):
(JSC::JSModuleLoader::translate):
(JSC::JSModuleLoader::instantiate):
(JSC::JSModuleLoader::evaluate):
* runtime/JSModuleLoader.h:
* runtime/ModuleLoaderPrototype.cpp:
(JSC::moduleLoaderPrototypeResolve):
(JSC::moduleLoaderPrototypeFetch):
(JSC::moduleLoaderPrototypeTranslate):
(JSC::moduleLoaderPrototypeInstantiate):
(JSC::moduleLoaderPrototypeEvaluate):
Source/WebCore:
No user-observable behavior change.
We rename JSModuleLoader to ScriptModuleLoader.
The name "JSModuleLoader" is misleading since it seems like this is a JS object.
"ModuleLoader" is not good since there is CSS modules.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::moduleLoaderResolve):
(WebCore::JSDOMWindowBase::moduleLoaderFetch):
(WebCore::JSDOMWindowBase::moduleLoaderEvaluate):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSMainThreadExecState.h:
(WebCore::JSMainThreadExecState::loadModule):
(WebCore::JSMainThreadExecState::linkAndEvaluateModule):
* bindings/js/JSModuleLoader.cpp:
(WebCore::JSModuleLoader::JSModuleLoader): Deleted.
(WebCore::JSModuleLoader::resolve): Deleted.
(WebCore::JSModuleLoader::fetch): Deleted.
(WebCore::JSModuleLoader::evaluate): Deleted.
* bindings/js/JSModuleLoader.h:
(WebCore::JSModuleLoader::document): Deleted.
* bindings/js/ScriptModuleLoader.cpp: Renamed from Source/WebCore/bindings/js/JSModuleLoader.cpp.
(WebCore::ScriptModuleLoader::ScriptModuleLoader):
(WebCore::ScriptModuleLoader::resolve):
(WebCore::ScriptModuleLoader::fetch):
(WebCore::ScriptModuleLoader::evaluate):
* bindings/js/ScriptModuleLoader.h: Renamed from Source/WebCore/bindings/js/JSModuleLoader.h.
(WebCore::ScriptModuleLoader::document):
* dom/Document.cpp:
(WebCore::Document::Document):
* dom/Document.h:
(WebCore::Document::moduleLoader):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit214SourceJavaScriptCoreChangeLog">releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceJavaScriptCorebuiltinsModuleLoaderPrototypejs">releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/builtins/ModuleLoaderPrototype.js</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceJavaScriptCorebytecodeBytecodeIntrinsicRegistrycpp">releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceJavaScriptCorebytecodeBytecodeIntrinsicRegistryh">releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceJavaScriptCorejsccpp">releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/jsc.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceJavaScriptCoreruntimeCompletioncpp">releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/Completion.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceJavaScriptCoreruntimeCompletionh">releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/Completion.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceJavaScriptCoreruntimeJSGlobalObjecth">releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/JSGlobalObject.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceJavaScriptCoreruntimeJSModuleLoadercpp">releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/JSModuleLoader.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceJavaScriptCoreruntimeJSModuleLoaderh">releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/JSModuleLoader.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceJavaScriptCoreruntimeModuleLoaderPrototypecpp">releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/ModuleLoaderPrototype.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreCMakeListstxt">releases/WebKitGTK/webkit-2.14/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreWebCorexcodeprojprojectpbxproj">releases/WebKitGTK/webkit-2.14/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCorebindingsjsJSBindingsAllInOnecpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCorebindingsjsJSDOMWindowBasecpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSDOMWindowBase.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCorebindingsjsJSDOMWindowBaseh">releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSDOMWindowBase.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCorebindingsjsJSMainThreadExecStateh">releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSMainThreadExecState.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoredomDocumentcpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoredomDocumenth">releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/Document.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCorebindingsjsScriptModuleLoadercpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/ScriptModuleLoader.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCorebindingsjsScriptModuleLoaderh">releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/ScriptModuleLoader.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCorebindingsjsJSModuleLoadercpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSModuleLoader.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCorebindingsjsJSModuleLoaderh">releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSModuleLoader.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit214SourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/ChangeLog (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/ChangeLog        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/ChangeLog        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -1,5 +1,69 @@
</span><span class="cx"> 2016-08-31 Yusuke Suzuki <utatane.tea@gmail.com>
</span><span class="cx">
</span><ins>+ [JSC] Add initiator parameter to module pipeline
+ https://bugs.webkit.org/show_bug.cgi?id=161470
+
+ Reviewed by Saam Barati.
+
+ The fetching semantics of the <script type="module"> tag has per module-tag context.
+ For example, "nonce", "crossorigin" etc. attributes are shared in the fetching requests
+ issued from the module-tag. To transfer this information, we add a new parameter "initiator"
+ to the module loader pipeline. We are planning to transfer information by this parameter.
+
+ At the same time, we also perform some clean up.
+
+ - Use arrow function in ModuleLoaderPrototype.js.
+ - Rename "ResolveDependencies" to "Satisfy" to align to the loader spec.
+
+ * builtins/ModuleLoaderPrototype.js:
+ (newRegistryEntry):
+ (commitInstantiated):
+ (requestFetch):
+ (requestTranslate):
+ (requestInstantiate):
+ (requestSatisfy):
+ (requestInstantiateAll):
+ (requestLink):
+ (moduleEvaluation):
+ (provide):
+ (loadAndEvaluateModule):
+ (requestResolveDependencies.): Deleted.
+ (requestResolveDependencies): Deleted.
+ (requestReady): Deleted.
+ (link): Deleted.
+ (loadModule): Deleted.
+ (linkAndEvaluateModule): Deleted.
+ * bytecode/BytecodeIntrinsicRegistry.cpp:
+ (JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
+ * bytecode/BytecodeIntrinsicRegistry.h:
+ * jsc.cpp:
+ (GlobalObject::moduleLoaderResolve):
+ (GlobalObject::moduleLoaderFetch):
+ * runtime/Completion.cpp:
+ (JSC::loadAndEvaluateModule):
+ (JSC::loadModule):
+ (JSC::linkAndEvaluateModule):
+ * runtime/Completion.h:
+ * runtime/JSGlobalObject.h:
+ * runtime/JSModuleLoader.cpp:
+ (JSC::JSModuleLoader::loadAndEvaluateModule):
+ (JSC::JSModuleLoader::loadModule):
+ (JSC::JSModuleLoader::linkAndEvaluateModule):
+ (JSC::JSModuleLoader::resolve):
+ (JSC::JSModuleLoader::fetch):
+ (JSC::JSModuleLoader::translate):
+ (JSC::JSModuleLoader::instantiate):
+ (JSC::JSModuleLoader::evaluate):
+ * runtime/JSModuleLoader.h:
+ * runtime/ModuleLoaderPrototype.cpp:
+ (JSC::moduleLoaderPrototypeResolve):
+ (JSC::moduleLoaderPrototypeFetch):
+ (JSC::moduleLoaderPrototypeTranslate):
+ (JSC::moduleLoaderPrototypeInstantiate):
+ (JSC::moduleLoaderPrototypeEvaluate):
+
+2016-08-31 Yusuke Suzuki <utatane.tea@gmail.com>
+
</ins><span class="cx"> [JSC] linking and evaluating the modules are done in a sync manner
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=161467
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceJavaScriptCorebuiltinsModuleLoaderPrototypejs"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/builtins/ModuleLoaderPrototype.js (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/builtins/ModuleLoaderPrototype.js        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/builtins/ModuleLoaderPrototype.js        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -69,11 +69,11 @@
</span><span class="cx"> // b. If the status is Instantiate and there is the entry.translate promise, the entry is just instantiating
</span><span class="cx"> // the module record.
</span><span class="cx"> //
</span><del>- // 4. ResolveDependencies (not in the draft) https://github.com/whatwg/loader/issues/68
</del><ins>+ // 4. Satisfy
</ins><span class="cx"> // Ready to request the dependent modules (or now requesting & resolving).
</span><span class="cx"> // Without this state, the current draft causes infinite recursion when there is circular dependency.
</span><del>- // a. If the status is ResolveDependencies and there is no entry.resolveDependencies promise, the entry is ready to resolve the dependencies.
- // b. If the status is ResolveDependencies and there is the entry.resolveDependencies promise, the entry is just resolving
</del><ins>+ // a. If the status is Satisfy and there is no entry.satisfy promise, the entry is ready to resolve the dependencies.
+ // b. If the status is Satisfy and there is the entry.satisfy promise, the entry is just resolving
</ins><span class="cx"> // the dependencies.
</span><span class="cx"> //
</span><span class="cx"> // 5. Link
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx"> // 6. Ready
</span><span class="cx"> // The module is linked, so the module is ready to be executed.
</span><span class="cx"> //
</span><del>- // Each registry entry has the 4 promises; "fetch", "translate", "instantiate" and "resolveDependencies".
</del><ins>+ // Each registry entry has the 4 promises; "fetch", "translate", "instantiate" and "satisfy".
</ins><span class="cx"> // They are assigned when starting the each phase. And they are fulfilled when the each phase is completed.
</span><span class="cx"> //
</span><span class="cx"> // In the current module draft, linking will be performed after the whole modules are instantiated and the dependencies are resolved.
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx"> fetch: @undefined,
</span><span class="cx"> translate: @undefined,
</span><span class="cx"> instantiate: @undefined,
</span><del>- resolveDependencies: @undefined,
</del><ins>+ satisfy: @undefined,
</ins><span class="cx"> dependencies: [], // To keep the module order, we store the module keys in the array.
</span><span class="cx"> dependenciesMap: @undefined,
</span><span class="cx"> module: @undefined, // JSModuleRecord
</span><span class="lines">@@ -201,13 +201,13 @@
</span><span class="cx"> key: depKey,
</span><span class="cx"> value: @undefined
</span><span class="cx"> };
</span><del>- @putByValDirect(dependencies, i, pair);
</del><ins>+ dependencies.@push(pair);
</ins><span class="cx"> dependenciesMap.@set(depKey, pair);
</span><span class="cx"> }
</span><span class="cx"> entry.dependencies = dependencies;
</span><span class="cx"> entry.dependenciesMap = dependenciesMap;
</span><span class="cx"> entry.module = moduleRecord;
</span><del>- this.setStateToMax(entry, @ModuleResolveDependencies);
</del><ins>+ this.setStateToMax(entry, @ModuleSatisfy);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function instantiation(result, source, entry)
</span><span class="lines">@@ -223,7 +223,7 @@
</span><span class="cx">
</span><span class="cx"> // Loader.
</span><span class="cx">
</span><del>-function requestFetch(key)
</del><ins>+function requestFetch(key, initiator)
</ins><span class="cx"> {
</span><span class="cx"> // https://whatwg.github.io/loader/#request-fetch
</span><span class="cx">
</span><span class="lines">@@ -239,8 +239,6 @@
</span><span class="cx"> if (entry.fetch)
</span><span class="cx"> return entry.fetch;
</span><span class="cx">
</span><del>- var loader = this;
-
</del><span class="cx"> // Hook point.
</span><span class="cx"> // 2. Loader.fetch
</span><span class="cx"> // https://whatwg.github.io/loader/#browser-fetch
</span><span class="lines">@@ -247,8 +245,8 @@
</span><span class="cx"> // Take the key and fetch the resource actually.
</span><span class="cx"> // For example, JavaScriptCore shell can provide the hook fetching the resource
</span><span class="cx"> // from the local file system.
</span><del>- var fetchPromise = this.fetch(key).then(function (payload) {
- loader.setStateToMax(entry, @ModuleTranslate);
</del><ins>+ var fetchPromise = this.fetch(key, initiator).then((payload) => {
+ this.setStateToMax(entry, @ModuleTranslate);
</ins><span class="cx"> return payload;
</span><span class="cx"> });
</span><span class="cx"> entry.fetch = fetchPromise;
</span><span class="lines">@@ -255,7 +253,7 @@
</span><span class="cx"> return fetchPromise;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-function requestTranslate(key)
</del><ins>+function requestTranslate(key, initiator)
</ins><span class="cx"> {
</span><span class="cx"> // https://whatwg.github.io/loader/#request-translate
</span><span class="cx">
</span><span class="lines">@@ -271,15 +269,14 @@
</span><span class="cx"> if (entry.translate)
</span><span class="cx"> return entry.translate;
</span><span class="cx">
</span><del>- var loader = this;
- var translatePromise = this.requestFetch(key).then(function (payload) {
</del><ins>+ var translatePromise = this.requestFetch(key, initiator).then((payload) => {
</ins><span class="cx"> // Hook point.
</span><span class="cx"> // 3. Loader.translate
</span><span class="cx"> // https://whatwg.github.io/loader/#browser-translate
</span><span class="cx"> // Take the key and the fetched source code and translate it to the ES6 source code.
</span><span class="cx"> // Typically it is used by the transpilers.
</span><del>- return loader.translate(key, payload).then(function (source) {
- loader.setStateToMax(entry, @ModuleInstantiate);
</del><ins>+ return this.translate(key, payload, initiator).then((source) => {
+ this.setStateToMax(entry, @ModuleInstantiate);
</ins><span class="cx"> return source;
</span><span class="cx"> });
</span><span class="cx"> });
</span><span class="lines">@@ -287,7 +284,7 @@
</span><span class="cx"> return translatePromise;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-function requestInstantiate(key)
</del><ins>+function requestInstantiate(key, initiator)
</ins><span class="cx"> {
</span><span class="cx"> // https://whatwg.github.io/loader/#request-instantiate
</span><span class="cx">
</span><span class="lines">@@ -303,8 +300,7 @@
</span><span class="cx"> if (entry.instantiate)
</span><span class="cx"> return entry.instantiate;
</span><span class="cx">
</span><del>- var loader = this;
- var instantiatePromise = this.requestTranslate(key).then(function (source) {
</del><ins>+ var instantiatePromise = this.requestTranslate(key, initiator).then((source) => {
</ins><span class="cx"> // Hook point.
</span><span class="cx"> // 4. Loader.instantiate
</span><span class="cx"> // https://whatwg.github.io/loader/#browser-instantiate
</span><span class="lines">@@ -312,8 +308,8 @@
</span><span class="cx"> // by parsing the module source code.
</span><span class="cx"> // It has the chance to provide the optional module instance that is different from
</span><span class="cx"> // the ordinary one.
</span><del>- return loader.instantiate(key, source).then(function (optionalInstance) {
- loader.commitInstantiated(entry, optionalInstance, source);
</del><ins>+ return this.instantiate(key, source, initiator).then((optionalInstance) => {
+ this.commitInstantiated(entry, optionalInstance, source);
</ins><span class="cx"> return entry;
</span><span class="cx"> });
</span><span class="cx"> });
</span><span class="lines">@@ -321,17 +317,9 @@
</span><span class="cx"> return instantiatePromise;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-function requestResolveDependencies(key)
</del><ins>+function requestSatisfy(key, initiator)
</ins><span class="cx"> {
</span><del>- // FIXME: In the spec, after requesting instantiation, we will resolve
- // the dependencies without any status change. As a result, when there
- // is circular dependencies, instantiation is done only once, but
- // repeatedly resolving the dependencies. This means that infinite
- // recursion occur when the given modules have circular dependency. To
- // avoid this situation, we introduce new state, "ResolveDependencies". This means
- // "Now the module is instantiated, so ready to resolve the dependencies
- // or now resolving them".
- // https://github.com/whatwg/loader/issues/68
</del><ins>+ // https://whatwg.github.io/loader/#satisfy-instance
</ins><span class="cx">
</span><span class="cx"> "use strict";
</span><span class="cx">
</span><span class="lines">@@ -342,11 +330,10 @@
</span><span class="cx"> return deferred.@promise;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (entry.resolveDependencies)
- return entry.resolveDependencies;
</del><ins>+ if (entry.satisfy)
+ return entry.satisfy;
</ins><span class="cx">
</span><del>- var loader = this;
- var resolveDependenciesPromise = this.requestInstantiate(key).then(function (entry) {
</del><ins>+ var satisfyPromise = this.requestInstantiate(key, initiator).then((entry) => {
</ins><span class="cx"> var depLoads = [];
</span><span class="cx"> for (var i = 0, length = entry.dependencies.length; i < length; ++i) {
</span><span class="cx"> let pair = entry.dependencies[i];
</span><span class="lines">@@ -356,8 +343,8 @@
</span><span class="cx"> // https://whatwg.github.io/loader/#browser-resolve
</span><span class="cx"> // Take the name and resolve it to the unique identifier for the resource location.
</span><span class="cx"> // For example, take the "jquery" and return the URL for the resource.
</span><del>- var promise = loader.resolve(pair.key, key).then(function (depKey) {
- var depEntry = loader.ensureRegistered(depKey);
</del><ins>+ var promise = this.resolve(pair.key, key, initiator).then((depKey) => {
+ var depEntry = this.ensureRegistered(depKey);
</ins><span class="cx">
</span><span class="cx"> // Recursive resolving. The dependencies of this entry is being resolved or already resolved.
</span><span class="cx"> // Stop tracing the circular dependencies.
</span><span class="lines">@@ -365,44 +352,44 @@
</span><span class="cx"> // we need to wait for the instantiation for the dependent module.
</span><span class="cx"> // For example, reaching here, the module is starting resolving the dependencies.
</span><span class="cx"> // But the module may or may not reach the instantiation phase in the loader's pipeline.
</span><del>- // If we wait for the ResolveDependencies for this module, it construct the circular promise chain and
</del><ins>+ // If we wait for the Satisfy for this module, it construct the circular promise chain and
</ins><span class="cx"> // rejected by the Promises runtime. Since only we need is the instantiated module, instead of waiting
</span><del>- // the ResolveDependencies for this module, we just wait Instantiate for this.
- if (depEntry.resolveDependencies) {
- return depEntry.instantiate.then(function (entry) {
</del><ins>+ // the Satisfy for this module, we just wait Instantiate for this.
+ if (depEntry.satisfy) {
+ return depEntry.instantiate.then((entry) => {
</ins><span class="cx"> pair.value = entry.module;
</span><span class="cx"> return entry;
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return loader.requestResolveDependencies(depKey).then(function (entry) {
</del><ins>+ return this.requestSatisfy(depKey, initiator).then((entry) => {
</ins><span class="cx"> pair.value = entry.module;
</span><span class="cx"> return entry;
</span><span class="cx"> });
</span><span class="cx"> });
</span><del>- @putByValDirect(depLoads, i, promise);
</del><ins>+ depLoads.@push(promise);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- return @InternalPromise.internalAll(depLoads).then(function (modules) {
- loader.setStateToMax(entry, @ModuleLink);
</del><ins>+ return @InternalPromise.internalAll(depLoads).then((modules) => {
+ this.setStateToMax(entry, @ModuleLink);
</ins><span class="cx"> return entry;
</span><span class="cx"> });
</span><span class="cx"> });
</span><span class="cx">
</span><del>- entry.resolveDependencies = resolveDependenciesPromise;
- return resolveDependenciesPromise;
</del><ins>+ entry.satisfy = satisfyPromise;
+ return satisfyPromise;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-function requestInstantiateAll(key)
</del><ins>+function requestInstantiateAll(key, initiator)
</ins><span class="cx"> {
</span><span class="cx"> // https://whatwg.github.io/loader/#request-instantiate-all
</span><span class="cx">
</span><span class="cx"> "use strict";
</span><span class="cx">
</span><del>- return this.requestResolveDependencies(key);
</del><ins>+ return this.requestSatisfy(key, initiator);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-function requestLink(key)
</del><ins>+function requestLink(key, initiator)
</ins><span class="cx"> {
</span><span class="cx"> // https://whatwg.github.io/loader/#request-link
</span><span class="cx">
</span><span class="lines">@@ -411,32 +398,30 @@
</span><span class="cx"> var entry = this.ensureRegistered(key);
</span><span class="cx"> if (entry.state > @ModuleLink) {
</span><span class="cx"> var deferred = @newPromiseCapability(@InternalPromise);
</span><del>- deferred.@resolve.@call(@undefined, entry.module);
</del><ins>+ deferred.@resolve.@call(@undefined, entry);
</ins><span class="cx"> return deferred.@promise;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- var loader = this;
- return this.requestInstantiateAll(key).then(function (entry) {
- loader.link(entry);
</del><ins>+ return this.requestInstantiateAll(key, initiator).then((entry) => {
+ this.link(entry, initiator);
</ins><span class="cx"> return entry;
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><del>-function requestReady(key)
</del><ins>+function requestReady(key, initiator)
</ins><span class="cx"> {
</span><span class="cx"> // https://whatwg.github.io/loader/#request-ready
</span><span class="cx">
</span><span class="cx"> "use strict";
</span><span class="cx">
</span><del>- var loader = this;
- return this.requestLink(key).then(function (entry) {
- loader.moduleEvaluation(entry.module);
</del><ins>+ return this.requestLink(key, initiator).then((entry) => {
+ this.moduleEvaluation(entry.module, initiator);
</ins><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Linking semantics.
</span><span class="cx">
</span><del>-function link(entry)
</del><ins>+function link(entry, initiator)
</ins><span class="cx"> {
</span><span class="cx"> // https://whatwg.github.io/loader/#link
</span><span class="cx">
</span><span class="lines">@@ -456,15 +441,15 @@
</span><span class="cx"> var dependencies = entry.dependencies;
</span><span class="cx"> for (var i = 0, length = dependencies.length; i < length; ++i) {
</span><span class="cx"> var pair = dependencies[i];
</span><del>- this.link(pair.value.registryEntry);
</del><ins>+ this.link(pair.value.registryEntry, initiator);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- this.moduleDeclarationInstantiation(entry.module);
</del><ins>+ this.moduleDeclarationInstantiation(entry.module, initiator);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Module semantics.
</span><span class="cx">
</span><del>-function moduleEvaluation(moduleRecord)
</del><ins>+function moduleEvaluation(moduleRecord, initiator)
</ins><span class="cx"> {
</span><span class="cx"> // http://www.ecma-international.org/ecma-262/6.0/#sec-moduleevaluation
</span><span class="cx">
</span><span class="lines">@@ -481,9 +466,9 @@
</span><span class="cx"> for (var i = 0, length = dependencies.length; i < length; ++i) {
</span><span class="cx"> var pair = dependencies[i];
</span><span class="cx"> var requiredModuleRecord = pair.value;
</span><del>- this.moduleEvaluation(requiredModuleRecord);
</del><ins>+ this.moduleEvaluation(requiredModuleRecord, initiator);
</ins><span class="cx"> }
</span><del>- this.evaluate(entry.key, moduleRecord);
</del><ins>+ this.evaluate(entry.key, moduleRecord, initiator);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // APIs to control the module loader.
</span><span class="lines">@@ -495,7 +480,7 @@
</span><span class="cx"> var entry = this.ensureRegistered(key);
</span><span class="cx">
</span><span class="cx"> if (stage === @ModuleFetch) {
</span><del>- if (entry.status > @ModuleFetch)
</del><ins>+ if (entry.state > @ModuleFetch)
</ins><span class="cx"> throw new @TypeError("Requested module is already fetched.");
</span><span class="cx"> this.fulfillFetch(entry, value);
</span><span class="cx"> return;
</span><span class="lines">@@ -502,7 +487,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (stage === @ModuleTranslate) {
</span><del>- if (entry.status > @ModuleTranslate)
</del><ins>+ if (entry.state > @ModuleTranslate)
</ins><span class="cx"> throw new @TypeError("Requested module is already translated.");
</span><span class="cx"> this.fulfillFetch(entry, @undefined);
</span><span class="cx"> this.fulfillTranslate(entry, value);
</span><span class="lines">@@ -510,13 +495,12 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (stage === @ModuleInstantiate) {
</span><del>- if (entry.status > @ModuleInstantiate)
</del><ins>+ if (entry.state > @ModuleInstantiate)
</ins><span class="cx"> throw new @TypeError("Requested module is already instantiated.");
</span><span class="cx"> this.fulfillFetch(entry, @undefined);
</span><span class="cx"> this.fulfillTranslate(entry, value);
</span><del>- var loader = this;
- entry.translate.then(function (source) {
- loader.fulfillInstantiate(entry, value, source);
</del><ins>+ entry.translate.then((source) => {
+ this.fulfillInstantiate(entry, value, source);
</ins><span class="cx"> });
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -524,37 +508,35 @@
</span><span class="cx"> throw new @TypeError("Requested module is already ready to be executed.");
</span><span class="cx"> }
</span><span class="cx">
</span><del>-function loadAndEvaluateModule(moduleName, referrer)
</del><ins>+function loadAndEvaluateModule(moduleName, referrer, initiator)
</ins><span class="cx"> {
</span><span class="cx"> "use strict";
</span><span class="cx">
</span><del>- var loader = this;
</del><span class="cx"> // Loader.resolve hook point.
</span><span class="cx"> // resolve: moduleName => Promise(moduleKey)
</span><span class="cx"> // Take the name and resolve it to the unique identifier for the resource location.
</span><span class="cx"> // For example, take the "jquery" and return the URL for the resource.
</span><del>- return this.resolve(moduleName, referrer).then(function (key) {
- return loader.requestReady(key);
</del><ins>+ return this.resolve(moduleName, referrer, initiator).then((key) => {
+ return this.requestReady(key, initiator);
</ins><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><del>-function loadModule(moduleName, referrer)
</del><ins>+function loadModule(moduleName, referrer, initiator)
</ins><span class="cx"> {
</span><span class="cx"> "use strict";
</span><span class="cx">
</span><del>- var loader = this;
</del><span class="cx"> // Loader.resolve hook point.
</span><span class="cx"> // resolve: moduleName => Promise(moduleKey)
</span><span class="cx"> // Take the name and resolve it to the unique identifier for the resource location.
</span><span class="cx"> // For example, take the "jquery" and return the URL for the resource.
</span><del>- return this.resolve(moduleName, referrer).then(function (key) {
- return loader.requestInstantiateAll(key);
- }).then(function (entry) {
</del><ins>+ return this.resolve(moduleName, referrer, initiator).then((key) => {
+ return this.requestInstantiateAll(key, initiator);
+ }).then((entry) => {
</ins><span class="cx"> return entry.key;
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><del>-function linkAndEvaluateModule(key)
</del><ins>+function linkAndEvaluateModule(key, initiator)
</ins><span class="cx"> {
</span><span class="cx"> "use strict";
</span><span class="cx">
</span><span class="lines">@@ -562,6 +544,6 @@
</span><span class="cx"> if (entry.state < @ModuleLink)
</span><span class="cx"> throw new @TypeError("Requested module is not instantiated yet.");
</span><span class="cx">
</span><del>- this.link(entry);
- return this.moduleEvaluation(entry.module);
</del><ins>+ this.link(entry, initiator);
+ return this.moduleEvaluation(entry.module, initiator);
</ins><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceJavaScriptCorebytecodeBytecodeIntrinsicRegistrycpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.cpp (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.cpp        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.cpp        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx"> m_ModuleFetch.set(m_vm, jsNumber(static_cast<unsigned>(JSModuleLoader::Status::Fetch)));
</span><span class="cx"> m_ModuleTranslate.set(m_vm, jsNumber(static_cast<unsigned>(JSModuleLoader::Status::Translate)));
</span><span class="cx"> m_ModuleInstantiate.set(m_vm, jsNumber(static_cast<unsigned>(JSModuleLoader::Status::Instantiate)));
</span><del>- m_ModuleResolveDependencies.set(m_vm, jsNumber(static_cast<unsigned>(JSModuleLoader::Status::ResolveDependencies)));
</del><ins>+ m_ModuleSatisfy.set(m_vm, jsNumber(static_cast<unsigned>(JSModuleLoader::Status::Satisfy)));
</ins><span class="cx"> m_ModuleLink.set(m_vm, jsNumber(static_cast<unsigned>(JSModuleLoader::Status::Link)));
</span><span class="cx"> m_ModuleReady.set(m_vm, jsNumber(static_cast<unsigned>(JSModuleLoader::Status::Ready)));
</span><span class="cx"> m_promiseStatePending.set(m_vm, jsNumber(static_cast<unsigned>(JSPromise::Status::Pending)));
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceJavaScriptCorebytecodeBytecodeIntrinsicRegistryh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.h (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.h        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.h        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx"> macro(ModuleFetch) \
</span><span class="cx"> macro(ModuleTranslate) \
</span><span class="cx"> macro(ModuleInstantiate) \
</span><del>- macro(ModuleResolveDependencies) \
</del><ins>+ macro(ModuleSatisfy) \
</ins><span class="cx"> macro(ModuleLink) \
</span><span class="cx"> macro(ModuleReady) \
</span><span class="cx"> macro(promiseStatePending) \
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceJavaScriptCorejsccpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/jsc.cpp (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/jsc.cpp        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/jsc.cpp        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -896,8 +896,8 @@
</span><span class="cx"> putDirect(vm, identifier, JSFunction::create(vm, this, arguments, identifier.string(), function, NoIntrinsic, function));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- static JSInternalPromise* moduleLoaderResolve(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue, JSValue);
- static JSInternalPromise* moduleLoaderFetch(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue);
</del><ins>+ static JSInternalPromise* moduleLoaderResolve(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue, JSValue, JSValue);
+ static JSInternalPromise* moduleLoaderFetch(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue, JSValue);
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> const ClassInfo GlobalObject::s_info = { "global", &JSGlobalObject::s_info, nullptr, CREATE_METHOD_TABLE(GlobalObject) };
</span><span class="lines">@@ -1028,7 +1028,7 @@
</span><span class="cx"> return builder.toString();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-JSInternalPromise* GlobalObject::moduleLoaderResolve(JSGlobalObject* globalObject, ExecState* exec, JSModuleLoader*, JSValue keyValue, JSValue referrerValue)
</del><ins>+JSInternalPromise* GlobalObject::moduleLoaderResolve(JSGlobalObject* globalObject, ExecState* exec, JSModuleLoader*, JSValue keyValue, JSValue referrerValue, JSValue)
</ins><span class="cx"> {
</span><span class="cx"> JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject);
</span><span class="cx"> const Identifier key = keyValue.toPropertyKey(exec);
</span><span class="lines">@@ -1133,7 +1133,7 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-JSInternalPromise* GlobalObject::moduleLoaderFetch(JSGlobalObject* globalObject, ExecState* exec, JSModuleLoader*, JSValue key)
</del><ins>+JSInternalPromise* GlobalObject::moduleLoaderFetch(JSGlobalObject* globalObject, ExecState* exec, JSModuleLoader*, JSValue key, JSValue)
</ins><span class="cx"> {
</span><span class="cx"> JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject);
</span><span class="cx"> String moduleKey = key.toWTFString(exec);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceJavaScriptCoreruntimeCompletioncpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/Completion.cpp (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/Completion.cpp        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/Completion.cpp        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -155,26 +155,26 @@
</span><span class="cx"> return deferred->promise();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static JSInternalPromise* loadAndEvaluateModule(const JSLockHolder&, ExecState* exec, JSGlobalObject* globalObject, JSValue moduleName, JSValue referrer)
</del><ins>+static JSInternalPromise* loadAndEvaluateModule(const JSLockHolder&, ExecState* exec, JSGlobalObject* globalObject, JSValue moduleName, JSValue referrer, JSValue initiator)
</ins><span class="cx"> {
</span><del>- return globalObject->moduleLoader()->loadAndEvaluateModule(exec, moduleName, referrer);
</del><ins>+ return globalObject->moduleLoader()->loadAndEvaluateModule(exec, moduleName, referrer, initiator);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static JSInternalPromise* loadAndEvaluateModule(const JSLockHolder& lock, ExecState* exec, JSGlobalObject* globalObject, const Identifier& moduleName)
</del><ins>+static JSInternalPromise* loadAndEvaluateModule(const JSLockHolder& lock, ExecState* exec, JSGlobalObject* globalObject, const Identifier& moduleName, JSValue initiator)
</ins><span class="cx"> {
</span><del>- return loadAndEvaluateModule(lock, exec, globalObject, identifierToJSValue(exec->vm(), moduleName), jsUndefined());
</del><ins>+ return loadAndEvaluateModule(lock, exec, globalObject, identifierToJSValue(exec->vm(), moduleName), jsUndefined(), initiator);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-JSInternalPromise* loadAndEvaluateModule(ExecState* exec, const String& moduleName)
</del><ins>+JSInternalPromise* loadAndEvaluateModule(ExecState* exec, const String& moduleName, JSValue initiator)
</ins><span class="cx"> {
</span><span class="cx"> JSLockHolder lock(exec);
</span><span class="cx"> RELEASE_ASSERT(exec->vm().atomicStringTable() == wtfThreadData().atomicStringTable());
</span><span class="cx"> RELEASE_ASSERT(!exec->vm().isCollectorBusy());
</span><span class="cx">
</span><del>- return loadAndEvaluateModule(lock, exec, exec->vmEntryGlobalObject(), Identifier::fromString(exec, moduleName));
</del><ins>+ return loadAndEvaluateModule(lock, exec, exec->vmEntryGlobalObject(), Identifier::fromString(exec, moduleName), initiator);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-JSInternalPromise* loadAndEvaluateModule(ExecState* exec, const SourceCode& source)
</del><ins>+JSInternalPromise* loadAndEvaluateModule(ExecState* exec, const SourceCode& source, JSValue initiator)
</ins><span class="cx"> {
</span><span class="cx"> JSLockHolder lock(exec);
</span><span class="cx"> RELEASE_ASSERT(exec->vm().atomicStringTable() == wtfThreadData().atomicStringTable());
</span><span class="lines">@@ -189,29 +189,29 @@
</span><span class="cx"> if (exec->hadException())
</span><span class="cx"> return rejectPromise(exec, globalObject);
</span><span class="cx">
</span><del>- return loadAndEvaluateModule(lock, exec, globalObject, key, jsUndefined());
</del><ins>+ return loadAndEvaluateModule(lock, exec, globalObject, key, jsUndefined(), initiator);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static JSInternalPromise* loadModule(const JSLockHolder&, ExecState* exec, JSGlobalObject* globalObject, JSValue moduleName, JSValue referrer)
</del><ins>+static JSInternalPromise* loadModule(const JSLockHolder&, ExecState* exec, JSGlobalObject* globalObject, JSValue moduleName, JSValue referrer, JSValue initiator)
</ins><span class="cx"> {
</span><del>- return globalObject->moduleLoader()->loadModule(exec, moduleName, referrer);
</del><ins>+ return globalObject->moduleLoader()->loadModule(exec, moduleName, referrer, initiator);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static JSInternalPromise* loadModule(const JSLockHolder& lock, ExecState* exec, JSGlobalObject* globalObject, const Identifier& moduleName)
</del><ins>+static JSInternalPromise* loadModule(const JSLockHolder& lock, ExecState* exec, JSGlobalObject* globalObject, const Identifier& moduleName, JSValue initiator)
</ins><span class="cx"> {
</span><del>- return loadModule(lock, exec, globalObject, identifierToJSValue(exec->vm(), moduleName), jsUndefined());
</del><ins>+ return loadModule(lock, exec, globalObject, identifierToJSValue(exec->vm(), moduleName), jsUndefined(), initiator);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-JSInternalPromise* loadModule(ExecState* exec, const String& moduleName)
</del><ins>+JSInternalPromise* loadModule(ExecState* exec, const String& moduleName, JSValue initiator)
</ins><span class="cx"> {
</span><span class="cx"> JSLockHolder lock(exec);
</span><span class="cx"> RELEASE_ASSERT(exec->vm().atomicStringTable() == wtfThreadData().atomicStringTable());
</span><span class="cx"> RELEASE_ASSERT(!exec->vm().isCollectorBusy());
</span><span class="cx">
</span><del>- return loadModule(lock, exec, exec->vmEntryGlobalObject(), Identifier::fromString(exec, moduleName));
</del><ins>+ return loadModule(lock, exec, exec->vmEntryGlobalObject(), Identifier::fromString(exec, moduleName), initiator);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-JSInternalPromise* loadModule(ExecState* exec, const SourceCode& source)
</del><ins>+JSInternalPromise* loadModule(ExecState* exec, const SourceCode& source, JSValue initiator)
</ins><span class="cx"> {
</span><span class="cx"> JSLockHolder lock(exec);
</span><span class="cx"> RELEASE_ASSERT(exec->vm().atomicStringTable() == wtfThreadData().atomicStringTable());
</span><span class="lines">@@ -222,14 +222,15 @@
</span><span class="cx"> JSGlobalObject* globalObject = exec->vmEntryGlobalObject();
</span><span class="cx">
</span><span class="cx"> // Insert the given source code to the ModuleLoader registry as the fetched registry entry.
</span><ins>+ // FIXME: Introduce JSSourceCode object to wrap around this source.
</ins><span class="cx"> globalObject->moduleLoader()->provide(exec, key, JSModuleLoader::Status::Fetch, source.view().toString());
</span><span class="cx"> if (exec->hadException())
</span><span class="cx"> return rejectPromise(exec, globalObject);
</span><span class="cx">
</span><del>- return loadModule(lock, exec, globalObject, key, jsUndefined());
</del><ins>+ return loadModule(lock, exec, globalObject, key, jsUndefined(), initiator);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-JSValue linkAndEvaluateModule(ExecState* exec, const Identifier& moduleKey)
</del><ins>+JSValue linkAndEvaluateModule(ExecState* exec, const Identifier& moduleKey, JSValue initiator)
</ins><span class="cx"> {
</span><span class="cx"> JSLockHolder lock(exec);
</span><span class="cx"> RELEASE_ASSERT(exec->vm().atomicStringTable() == wtfThreadData().atomicStringTable());
</span><span class="lines">@@ -236,7 +237,7 @@
</span><span class="cx"> RELEASE_ASSERT(!exec->vm().isCollectorBusy());
</span><span class="cx">
</span><span class="cx"> JSGlobalObject* globalObject = exec->vmEntryGlobalObject();
</span><del>- return globalObject->moduleLoader()->linkAndEvaluateModule(exec, identifierToJSValue(exec->vm(), moduleKey));
</del><ins>+ return globalObject->moduleLoader()->linkAndEvaluateModule(exec, identifierToJSValue(exec->vm(), moduleKey), initiator);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceJavaScriptCoreruntimeCompletionh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/Completion.h (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/Completion.h        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/Completion.h        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -58,15 +58,15 @@
</span><span class="cx"> JS_EXPORT_PRIVATE JSValue evaluateWithScopeExtension(ExecState*, const SourceCode&, JSObject* scopeExtension, NakedPtr<Exception>& returnedException);
</span><span class="cx">
</span><span class="cx"> // Load the module source and evaluate it.
</span><del>-JS_EXPORT_PRIVATE JSInternalPromise* loadAndEvaluateModule(ExecState*, const String& moduleName);
-JS_EXPORT_PRIVATE JSInternalPromise* loadAndEvaluateModule(ExecState*, const SourceCode&);
</del><ins>+JS_EXPORT_PRIVATE JSInternalPromise* loadAndEvaluateModule(ExecState*, const String& moduleName, JSValue initiator = jsUndefined());
+JS_EXPORT_PRIVATE JSInternalPromise* loadAndEvaluateModule(ExecState*, const SourceCode&, JSValue initiator = jsUndefined());
</ins><span class="cx">
</span><span class="cx"> // Fetch the module source, and instantiate the module record.
</span><del>-JS_EXPORT_PRIVATE JSInternalPromise* loadModule(ExecState*, const String& moduleName);
-JS_EXPORT_PRIVATE JSInternalPromise* loadModule(ExecState*, const SourceCode&);
</del><ins>+JS_EXPORT_PRIVATE JSInternalPromise* loadModule(ExecState*, const String& moduleName, JSValue initiator = jsUndefined());
+JS_EXPORT_PRIVATE JSInternalPromise* loadModule(ExecState*, const SourceCode&, JSValue initiator = jsUndefined());
</ins><span class="cx">
</span><span class="cx"> // Link and evaluate the already linked module. This function is called in a sync manner.
</span><del>-JS_EXPORT_PRIVATE JSValue linkAndEvaluateModule(ExecState*, const Identifier& moduleKey);
</del><ins>+JS_EXPORT_PRIVATE JSValue linkAndEvaluateModule(ExecState*, const Identifier& moduleKey, JSValue initiator = jsUndefined());
</ins><span class="cx">
</span><span class="cx"> } // namespace JSC
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceJavaScriptCoreruntimeJSGlobalObjecth"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/JSGlobalObject.h (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/JSGlobalObject.h        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/JSGlobalObject.h        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -166,19 +166,19 @@
</span><span class="cx"> typedef bool (*ShouldInterruptScriptBeforeTimeoutPtr)(const JSGlobalObject*);
</span><span class="cx"> ShouldInterruptScriptBeforeTimeoutPtr shouldInterruptScriptBeforeTimeout;
</span><span class="cx">
</span><del>- typedef JSInternalPromise* (*ModuleLoaderResolvePtr)(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue, JSValue);
</del><ins>+ typedef JSInternalPromise* (*ModuleLoaderResolvePtr)(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue, JSValue, JSValue);
</ins><span class="cx"> ModuleLoaderResolvePtr moduleLoaderResolve;
</span><span class="cx">
</span><del>- typedef JSInternalPromise* (*ModuleLoaderFetchPtr)(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue);
</del><ins>+ typedef JSInternalPromise* (*ModuleLoaderFetchPtr)(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue, JSValue);
</ins><span class="cx"> ModuleLoaderFetchPtr moduleLoaderFetch;
</span><span class="cx">
</span><del>- typedef JSInternalPromise* (*ModuleLoaderTranslatePtr)(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue, JSValue);
</del><ins>+ typedef JSInternalPromise* (*ModuleLoaderTranslatePtr)(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue, JSValue, JSValue);
</ins><span class="cx"> ModuleLoaderTranslatePtr moduleLoaderTranslate;
</span><span class="cx">
</span><del>- typedef JSInternalPromise* (*ModuleLoaderInstantiatePtr)(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue, JSValue);
</del><ins>+ typedef JSInternalPromise* (*ModuleLoaderInstantiatePtr)(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue, JSValue, JSValue);
</ins><span class="cx"> ModuleLoaderInstantiatePtr moduleLoaderInstantiate;
</span><span class="cx">
</span><del>- typedef JSValue (*ModuleLoaderEvaluatePtr)(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue, JSValue);
</del><ins>+ typedef JSValue (*ModuleLoaderEvaluatePtr)(JSGlobalObject*, ExecState*, JSModuleLoader*, JSValue, JSValue, JSValue);
</ins><span class="cx"> ModuleLoaderEvaluatePtr moduleLoaderEvaluate;
</span><span class="cx">
</span><span class="cx"> typedef String (*DefaultLanguageFunctionPtr)();
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceJavaScriptCoreruntimeJSModuleLoadercpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/JSModuleLoader.cpp (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/JSModuleLoader.cpp        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/JSModuleLoader.cpp        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx"> return call(exec, function, callType, callData, this, arguments);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-JSInternalPromise* JSModuleLoader::loadAndEvaluateModule(ExecState* exec, JSValue moduleName, JSValue referrer)
</del><ins>+JSInternalPromise* JSModuleLoader::loadAndEvaluateModule(ExecState* exec, JSValue moduleName, JSValue referrer, JSValue initiator)
</ins><span class="cx"> {
</span><span class="cx"> JSObject* function = jsCast<JSObject*>(get(exec, exec->propertyNames().builtinNames().loadAndEvaluateModulePublicName()));
</span><span class="cx"> CallData callData;
</span><span class="lines">@@ -96,11 +96,12 @@
</span><span class="cx"> MarkedArgumentBuffer arguments;
</span><span class="cx"> arguments.append(moduleName);
</span><span class="cx"> arguments.append(referrer);
</span><ins>+ arguments.append(initiator);
</ins><span class="cx">
</span><span class="cx"> return jsCast<JSInternalPromise*>(call(exec, function, callType, callData, this, arguments));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-JSInternalPromise* JSModuleLoader::loadModule(ExecState* exec, JSValue moduleName, JSValue referrer)
</del><ins>+JSInternalPromise* JSModuleLoader::loadModule(ExecState* exec, JSValue moduleName, JSValue referrer, JSValue initiator)
</ins><span class="cx"> {
</span><span class="cx"> JSObject* function = jsCast<JSObject*>(get(exec, exec->propertyNames().builtinNames().loadModulePublicName()));
</span><span class="cx"> CallData callData;
</span><span class="lines">@@ -110,11 +111,12 @@
</span><span class="cx"> MarkedArgumentBuffer arguments;
</span><span class="cx"> arguments.append(moduleName);
</span><span class="cx"> arguments.append(referrer);
</span><ins>+ arguments.append(initiator);
</ins><span class="cx">
</span><span class="cx"> return jsCast<JSInternalPromise*>(call(exec, function, callType, callData, this, arguments));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-JSValue JSModuleLoader::linkAndEvaluateModule(ExecState* exec, JSValue moduleKey)
</del><ins>+JSValue JSModuleLoader::linkAndEvaluateModule(ExecState* exec, JSValue moduleKey, JSValue initiator)
</ins><span class="cx"> {
</span><span class="cx"> JSObject* function = jsCast<JSObject*>(get(exec, exec->propertyNames().builtinNames().linkAndEvaluateModulePublicName()));
</span><span class="cx"> CallData callData;
</span><span class="lines">@@ -123,11 +125,12 @@
</span><span class="cx">
</span><span class="cx"> MarkedArgumentBuffer arguments;
</span><span class="cx"> arguments.append(moduleKey);
</span><ins>+ arguments.append(initiator);
</ins><span class="cx">
</span><span class="cx"> return call(exec, function, callType, callData, this, arguments);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-JSInternalPromise* JSModuleLoader::resolve(ExecState* exec, JSValue name, JSValue referrer)
</del><ins>+JSInternalPromise* JSModuleLoader::resolve(ExecState* exec, JSValue name, JSValue referrer, JSValue initiator)
</ins><span class="cx"> {
</span><span class="cx"> if (Options::dumpModuleLoadingState())
</span><span class="cx"> dataLog("Loader [resolve] ", printableModuleKey(exec, name), "\n");
</span><span class="lines">@@ -134,13 +137,13 @@
</span><span class="cx">
</span><span class="cx"> JSGlobalObject* globalObject = exec->lexicalGlobalObject();
</span><span class="cx"> if (globalObject->globalObjectMethodTable()->moduleLoaderResolve)
</span><del>- return globalObject->globalObjectMethodTable()->moduleLoaderResolve(globalObject, exec, this, name, referrer);
</del><ins>+ return globalObject->globalObjectMethodTable()->moduleLoaderResolve(globalObject, exec, this, name, referrer, initiator);
</ins><span class="cx"> JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject);
</span><span class="cx"> deferred->resolve(exec, name);
</span><span class="cx"> return deferred->promise();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-JSInternalPromise* JSModuleLoader::fetch(ExecState* exec, JSValue key)
</del><ins>+JSInternalPromise* JSModuleLoader::fetch(ExecState* exec, JSValue key, JSValue initiator)
</ins><span class="cx"> {
</span><span class="cx"> if (Options::dumpModuleLoadingState())
</span><span class="cx"> dataLog("Loader [fetch] ", printableModuleKey(exec, key), "\n");
</span><span class="lines">@@ -147,7 +150,7 @@
</span><span class="cx">
</span><span class="cx"> JSGlobalObject* globalObject = exec->lexicalGlobalObject();
</span><span class="cx"> if (globalObject->globalObjectMethodTable()->moduleLoaderFetch)
</span><del>- return globalObject->globalObjectMethodTable()->moduleLoaderFetch(globalObject, exec, this, key);
</del><ins>+ return globalObject->globalObjectMethodTable()->moduleLoaderFetch(globalObject, exec, this, key, initiator);
</ins><span class="cx"> JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject);
</span><span class="cx"> String moduleKey = key.toString(exec)->value(exec);
</span><span class="cx"> if (exec->hadException()) {
</span><span class="lines">@@ -160,7 +163,7 @@
</span><span class="cx"> return deferred->promise();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-JSInternalPromise* JSModuleLoader::translate(ExecState* exec, JSValue key, JSValue payload)
</del><ins>+JSInternalPromise* JSModuleLoader::translate(ExecState* exec, JSValue key, JSValue payload, JSValue initiator)
</ins><span class="cx"> {
</span><span class="cx"> if (Options::dumpModuleLoadingState())
</span><span class="cx"> dataLog("Loader [translate] ", printableModuleKey(exec, key), "\n");
</span><span class="lines">@@ -167,13 +170,13 @@
</span><span class="cx">
</span><span class="cx"> JSGlobalObject* globalObject = exec->lexicalGlobalObject();
</span><span class="cx"> if (globalObject->globalObjectMethodTable()->moduleLoaderTranslate)
</span><del>- return globalObject->globalObjectMethodTable()->moduleLoaderTranslate(globalObject, exec, this, key, payload);
</del><ins>+ return globalObject->globalObjectMethodTable()->moduleLoaderTranslate(globalObject, exec, this, key, payload, initiator);
</ins><span class="cx"> JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject);
</span><span class="cx"> deferred->resolve(exec, payload);
</span><span class="cx"> return deferred->promise();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-JSInternalPromise* JSModuleLoader::instantiate(ExecState* exec, JSValue key, JSValue source)
</del><ins>+JSInternalPromise* JSModuleLoader::instantiate(ExecState* exec, JSValue key, JSValue source, JSValue initiator)
</ins><span class="cx"> {
</span><span class="cx"> if (Options::dumpModuleLoadingState())
</span><span class="cx"> dataLog("Loader [instantiate] ", printableModuleKey(exec, key), "\n");
</span><span class="lines">@@ -180,13 +183,13 @@
</span><span class="cx">
</span><span class="cx"> JSGlobalObject* globalObject = exec->lexicalGlobalObject();
</span><span class="cx"> if (globalObject->globalObjectMethodTable()->moduleLoaderInstantiate)
</span><del>- return globalObject->globalObjectMethodTable()->moduleLoaderInstantiate(globalObject, exec, this, key, source);
</del><ins>+ return globalObject->globalObjectMethodTable()->moduleLoaderInstantiate(globalObject, exec, this, key, source, initiator);
</ins><span class="cx"> JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject);
</span><span class="cx"> deferred->resolve(exec, jsUndefined());
</span><span class="cx"> return deferred->promise();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-JSValue JSModuleLoader::evaluate(ExecState* exec, JSValue key, JSValue moduleRecordValue)
</del><ins>+JSValue JSModuleLoader::evaluate(ExecState* exec, JSValue key, JSValue moduleRecordValue, JSValue initiator)
</ins><span class="cx"> {
</span><span class="cx"> if (Options::dumpModuleLoadingState())
</span><span class="cx"> dataLog("Loader [evaluate] ", printableModuleKey(exec, key), "\n");
</span><span class="lines">@@ -193,7 +196,7 @@
</span><span class="cx">
</span><span class="cx"> JSGlobalObject* globalObject = exec->lexicalGlobalObject();
</span><span class="cx"> if (globalObject->globalObjectMethodTable()->moduleLoaderEvaluate)
</span><del>- return globalObject->globalObjectMethodTable()->moduleLoaderEvaluate(globalObject, exec, this, key, moduleRecordValue);
</del><ins>+ return globalObject->globalObjectMethodTable()->moduleLoaderEvaluate(globalObject, exec, this, key, moduleRecordValue, initiator);
</ins><span class="cx">
</span><span class="cx"> JSModuleRecord* moduleRecord = jsDynamicCast<JSModuleRecord*>(moduleRecordValue);
</span><span class="cx"> if (!moduleRecord)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceJavaScriptCoreruntimeJSModuleLoaderh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/JSModuleLoader.h (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/JSModuleLoader.h        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/JSModuleLoader.h        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> Fetch = 1,
</span><span class="cx"> Translate = 2,
</span><span class="cx"> Instantiate = 3,
</span><del>- ResolveDependencies = 4,
</del><ins>+ Satisfy = 4,
</ins><span class="cx"> Link = 5,
</span><span class="cx"> Ready = 6,
</span><span class="cx"> };
</span><span class="lines">@@ -63,18 +63,18 @@
</span><span class="cx">
</span><span class="cx"> // APIs to control the module loader.
</span><span class="cx"> JSValue provide(ExecState*, JSValue key, Status, const String&);
</span><del>- JSInternalPromise* loadAndEvaluateModule(ExecState*, JSValue moduleName, JSValue referrer);
- JSInternalPromise* loadModule(ExecState*, JSValue moduleName, JSValue referrer);
- JSValue linkAndEvaluateModule(ExecState*, JSValue moduleKey);
</del><ins>+ JSInternalPromise* loadAndEvaluateModule(ExecState*, JSValue moduleName, JSValue referrer, JSValue initiator);
+ JSInternalPromise* loadModule(ExecState*, JSValue moduleName, JSValue referrer, JSValue initiator);
+ JSValue linkAndEvaluateModule(ExecState*, JSValue moduleKey, JSValue initiator);
</ins><span class="cx">
</span><span class="cx"> // Platform dependent hooked APIs.
</span><del>- JSInternalPromise* resolve(ExecState*, JSValue name, JSValue referrer);
- JSInternalPromise* fetch(ExecState*, JSValue key);
- JSInternalPromise* translate(ExecState*, JSValue key, JSValue payload);
- JSInternalPromise* instantiate(ExecState*, JSValue key, JSValue source);
</del><ins>+ JSInternalPromise* resolve(ExecState*, JSValue name, JSValue referrer, JSValue initiator);
+ JSInternalPromise* fetch(ExecState*, JSValue key, JSValue initiator);
+ JSInternalPromise* translate(ExecState*, JSValue key, JSValue payload, JSValue initiator);
+ JSInternalPromise* instantiate(ExecState*, JSValue key, JSValue source, JSValue initiator);
</ins><span class="cx">
</span><span class="cx"> // Additional platform dependent hooked APIs.
</span><del>- JSValue evaluate(ExecState*, JSValue key, JSValue moduleRecord);
</del><ins>+ JSValue evaluate(ExecState*, JSValue key, JSValue moduleRecord, JSValue initiator);
</ins><span class="cx">
</span><span class="cx"> protected:
</span><span class="cx"> void finishCreation(VM&, JSGlobalObject*);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceJavaScriptCoreruntimeModuleLoaderPrototypecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/ModuleLoaderPrototype.cpp (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/ModuleLoaderPrototype.cpp        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/ModuleLoaderPrototype.cpp        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -66,36 +66,36 @@
</span><span class="cx">
</span><span class="cx"> /* Source for ModuleLoaderPrototype.lut.h
</span><span class="cx"> @begin moduleLoaderPrototypeTable
</span><del>- setStateToMax JSBuiltin DontEnum|Function 2
- newRegistryEntry JSBuiltin DontEnum|Function 1
- ensureRegistered JSBuiltin DontEnum|Function 1
- forceFulfillPromise JSBuiltin DontEnum|Function 2
- fulfillFetch JSBuiltin DontEnum|Function 2
- fulfillTranslate JSBuiltin DontEnum|Function 2
- fulfillInstantiate JSBuiltin DontEnum|Function 2
- commitInstantiated JSBuiltin DontEnum|Function 3
- instantiation JSBuiltin DontEnum|Function 3
- requestFetch JSBuiltin DontEnum|Function 1
- requestTranslate JSBuiltin DontEnum|Function 1
- requestInstantiate JSBuiltin DontEnum|Function 1
- requestResolveDependencies JSBuiltin DontEnum|Function 1
- requestInstantiateAll JSBuiltin DontEnum|Function 1
- requestLink JSBuiltin DontEnum|Function 1
- requestReady JSBuiltin DontEnum|Function 1
- link JSBuiltin DontEnum|Function 1
</del><ins>+ setStateToMax JSBuiltin DontEnum|Function 2
+ newRegistryEntry JSBuiltin DontEnum|Function 1
+ ensureRegistered JSBuiltin DontEnum|Function 1
+ forceFulfillPromise JSBuiltin DontEnum|Function 2
+ fulfillFetch JSBuiltin DontEnum|Function 2
+ fulfillTranslate JSBuiltin DontEnum|Function 2
+ fulfillInstantiate JSBuiltin DontEnum|Function 2
+ commitInstantiated JSBuiltin DontEnum|Function 3
+ instantiation JSBuiltin DontEnum|Function 3
+ requestFetch JSBuiltin DontEnum|Function 2
+ requestTranslate JSBuiltin DontEnum|Function 2
+ requestInstantiate JSBuiltin DontEnum|Function 2
+ requestSatisfy JSBuiltin DontEnum|Function 2
+ requestInstantiateAll JSBuiltin DontEnum|Function 2
+ requestLink JSBuiltin DontEnum|Function 2
+ requestReady JSBuiltin DontEnum|Function 2
+ link JSBuiltin DontEnum|Function 2
</ins><span class="cx"> moduleDeclarationInstantiation moduleLoaderPrototypeModuleDeclarationInstantiation DontEnum|Function 2
</span><del>- moduleEvaluation JSBuiltin DontEnum|Function 2
- evaluate moduleLoaderPrototypeEvaluate DontEnum|Function 2
- provide JSBuiltin DontEnum|Function 3
- loadAndEvaluateModule JSBuiltin DontEnum|Function 2
- loadModule JSBuiltin DontEnum|Function 2
- linkAndEvaluateModule JSBuiltin DontEnum|Function 1
</del><ins>+ moduleEvaluation JSBuiltin DontEnum|Function 2
+ evaluate moduleLoaderPrototypeEvaluate DontEnum|Function 3
+ provide JSBuiltin DontEnum|Function 3
+ loadAndEvaluateModule JSBuiltin DontEnum|Function 3
+ loadModule JSBuiltin DontEnum|Function 3
+ linkAndEvaluateModule JSBuiltin DontEnum|Function 2
</ins><span class="cx"> parseModule moduleLoaderPrototypeParseModule DontEnum|Function 2
</span><span class="cx"> requestedModules moduleLoaderPrototypeRequestedModules DontEnum|Function 1
</span><del>- resolve moduleLoaderPrototypeResolve DontEnum|Function 1
- fetch moduleLoaderPrototypeFetch DontEnum|Function 1
- translate moduleLoaderPrototypeTranslate DontEnum|Function 2
- instantiate moduleLoaderPrototypeInstantiate DontEnum|Function 2
</del><ins>+ resolve moduleLoaderPrototypeResolve DontEnum|Function 2
+ fetch moduleLoaderPrototypeFetch DontEnum|Function 2
+ translate moduleLoaderPrototypeTranslate DontEnum|Function 3
+ instantiate moduleLoaderPrototypeInstantiate DontEnum|Function 3
</ins><span class="cx"> @end
</span><span class="cx"> */
</span><span class="cx">
</span><span class="lines">@@ -183,7 +183,7 @@
</span><span class="cx"> JSModuleLoader* loader = jsDynamicCast<JSModuleLoader*>(exec->thisValue());
</span><span class="cx"> if (!loader)
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- return JSValue::encode(loader->resolve(exec, exec->argument(0), exec->argument(1)));
</del><ins>+ return JSValue::encode(loader->resolve(exec, exec->argument(0), exec->argument(1), exec->argument(2)));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL moduleLoaderPrototypeFetch(ExecState* exec)
</span><span class="lines">@@ -196,7 +196,7 @@
</span><span class="cx"> JSModuleLoader* loader = jsDynamicCast<JSModuleLoader*>(exec->thisValue());
</span><span class="cx"> if (!loader)
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- return JSValue::encode(loader->fetch(exec, exec->argument(0)));
</del><ins>+ return JSValue::encode(loader->fetch(exec, exec->argument(0), exec->argument(1)));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL moduleLoaderPrototypeTranslate(ExecState* exec)
</span><span class="lines">@@ -208,7 +208,7 @@
</span><span class="cx"> JSModuleLoader* loader = jsDynamicCast<JSModuleLoader*>(exec->thisValue());
</span><span class="cx"> if (!loader)
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- return JSValue::encode(loader->translate(exec, exec->argument(0), exec->argument(1)));
</del><ins>+ return JSValue::encode(loader->translate(exec, exec->argument(0), exec->argument(1), exec->argument(2)));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL moduleLoaderPrototypeInstantiate(ExecState* exec)
</span><span class="lines">@@ -222,7 +222,7 @@
</span><span class="cx"> JSModuleLoader* loader = jsDynamicCast<JSModuleLoader*>(exec->thisValue());
</span><span class="cx"> if (!loader)
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- return JSValue::encode(loader->instantiate(exec, exec->argument(0), exec->argument(1)));
</del><ins>+ return JSValue::encode(loader->instantiate(exec, exec->argument(0), exec->argument(1), exec->argument(2)));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // ------------------- Additional Hook Functions ---------------------------
</span><span class="lines">@@ -235,7 +235,7 @@
</span><span class="cx"> JSModuleLoader* loader = jsDynamicCast<JSModuleLoader*>(exec->thisValue());
</span><span class="cx"> if (!loader)
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- return JSValue::encode(loader->evaluate(exec, exec->argument(0), exec->argument(1)));
</del><ins>+ return JSValue::encode(loader->evaluate(exec, exec->argument(0), exec->argument(1), exec->argument(2)));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/CMakeLists.txt (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/CMakeLists.txt        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/CMakeLists.txt        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -1208,7 +1208,6 @@
</span><span class="cx"> bindings/js/JSMessageChannelCustom.cpp
</span><span class="cx"> bindings/js/JSMessageEventCustom.cpp
</span><span class="cx"> bindings/js/JSMessagePortCustom.cpp
</span><del>- bindings/js/JSModuleLoader.cpp
</del><span class="cx"> bindings/js/JSMutationCallback.cpp
</span><span class="cx"> bindings/js/JSMutationObserverCustom.cpp
</span><span class="cx"> bindings/js/JSNamedNodeMapCustom.cpp
</span><span class="lines">@@ -1257,6 +1256,7 @@
</span><span class="cx"> bindings/js/ScriptCachedFrameData.cpp
</span><span class="cx"> bindings/js/ScriptController.cpp
</span><span class="cx"> bindings/js/ScriptGlobalObject.cpp
</span><ins>+ bindings/js/ScriptModuleLoader.cpp
</ins><span class="cx"> bindings/js/ScriptState.cpp
</span><span class="cx"> bindings/js/StructuredClone.cpp
</span><span class="cx"> bindings/js/SerializedScriptValue.cpp
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2016-08-31 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ [JSC] Add initiator parameter to module pipeline
+ https://bugs.webkit.org/show_bug.cgi?id=161470
+
+ Reviewed by Saam Barati.
+
+ No user-observable behavior change.
+
+ We rename JSModuleLoader to ScriptModuleLoader.
+ The name "JSModuleLoader" is misleading since it seems like this is a JS object.
+ "ModuleLoader" is not good since there is CSS modules.
+
+ * CMakeLists.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSBindingsAllInOne.cpp:
+ * bindings/js/JSDOMWindowBase.cpp:
+ (WebCore::JSDOMWindowBase::moduleLoaderResolve):
+ (WebCore::JSDOMWindowBase::moduleLoaderFetch):
+ (WebCore::JSDOMWindowBase::moduleLoaderEvaluate):
+ * bindings/js/JSDOMWindowBase.h:
+ * bindings/js/JSMainThreadExecState.h:
+ (WebCore::JSMainThreadExecState::loadModule):
+ (WebCore::JSMainThreadExecState::linkAndEvaluateModule):
+ * bindings/js/JSModuleLoader.cpp:
+ (WebCore::JSModuleLoader::JSModuleLoader): Deleted.
+ (WebCore::JSModuleLoader::resolve): Deleted.
+ (WebCore::JSModuleLoader::fetch): Deleted.
+ (WebCore::JSModuleLoader::evaluate): Deleted.
+ * bindings/js/JSModuleLoader.h:
+ (WebCore::JSModuleLoader::document): Deleted.
+ * bindings/js/ScriptModuleLoader.cpp: Renamed from Source/WebCore/bindings/js/JSModuleLoader.cpp.
+ (WebCore::ScriptModuleLoader::ScriptModuleLoader):
+ (WebCore::ScriptModuleLoader::resolve):
+ (WebCore::ScriptModuleLoader::fetch):
+ (WebCore::ScriptModuleLoader::evaluate):
+ * bindings/js/ScriptModuleLoader.h: Renamed from Source/WebCore/bindings/js/JSModuleLoader.h.
+ (WebCore::ScriptModuleLoader::document):
+ * dom/Document.cpp:
+ (WebCore::Document::Document):
+ * dom/Document.h:
+ (WebCore::Document::moduleLoader):
+
</ins><span class="cx"> 2016-08-31 Zalan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><span class="cx"> ASSERTION FAILED: !flow->layer() && !flow->isInlineElementContinuation() in WebCore::RenderBlock::addContinuationWithOutline
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/WebCore.xcodeproj/project.pbxproj (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -6084,8 +6084,8 @@
</span><span class="cx">                 E1FF57A60F01256B00891EBB /* ThreadGlobalData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF57A50F01256B00891EBB /* ThreadGlobalData.cpp */; };
</span><span class="cx">                 E1FF8F6C180DB5BE00132674 /* CryptoAlgorithmRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F6A180DB5BE00132674 /* CryptoAlgorithmRegistry.cpp */; };
</span><span class="cx">                 E1FF8F6D180DB5BE00132674 /* CryptoAlgorithmRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF8F6B180DB5BE00132674 /* CryptoAlgorithmRegistry.h */; };
</span><del>-                E38838981BAD145F00D62EE3 /* JSModuleLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38838941BAD145F00D62EE3 /* JSModuleLoader.cpp */; };
-                E38838991BAD145F00D62EE3 /* JSModuleLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = E38838951BAD145F00D62EE3 /* JSModuleLoader.h */; };
</del><ins>+                E38838981BAD145F00D62EE3 /* ScriptModuleLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38838941BAD145F00D62EE3 /* ScriptModuleLoader.cpp */; };
+                E38838991BAD145F00D62EE3 /* ScriptModuleLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = E38838951BAD145F00D62EE3 /* ScriptModuleLoader.h */; };
</ins><span class="cx">                 E3FA38641D71812D00AA5950 /* PendingScriptClient.h in Headers */ = {isa = PBXBuildFile; fileRef = E3FA38611D716E7600AA5950 /* PendingScriptClient.h */; };
</span><span class="cx">                 E401C27517CE53EC00C41A35 /* ElementIteratorAssertions.h in Headers */ = {isa = PBXBuildFile; fileRef = E401C27417CE53EC00C41A35 /* ElementIteratorAssertions.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E401E0A41C3C0B8300F34D10 /* StyleChange.h in Headers */ = {isa = PBXBuildFile; fileRef = E401E0A31C3C0B8300F34D10 /* StyleChange.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -13646,8 +13646,8 @@
</span><span class="cx">                 E1FF8F661807460800132674 /* JSWebKitSubtleCryptoCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitSubtleCryptoCustom.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 E1FF8F6A180DB5BE00132674 /* CryptoAlgorithmRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmRegistry.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 E1FF8F6B180DB5BE00132674 /* CryptoAlgorithmRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRegistry.h; sourceTree = "<group>"; };
</span><del>-                E38838941BAD145F00D62EE3 /* JSModuleLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSModuleLoader.cpp; sourceTree = "<group>"; };
-                E38838951BAD145F00D62EE3 /* JSModuleLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSModuleLoader.h; sourceTree = "<group>"; };
</del><ins>+                E38838941BAD145F00D62EE3 /* ScriptModuleLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptModuleLoader.cpp; sourceTree = "<group>"; };
+                E38838951BAD145F00D62EE3 /* ScriptModuleLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptModuleLoader.h; sourceTree = "<group>"; };
</ins><span class="cx">                 E3FA38611D716E7600AA5950 /* PendingScriptClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PendingScriptClient.h; sourceTree = "<group>"; };
</span><span class="cx">                 E401C27417CE53EC00C41A35 /* ElementIteratorAssertions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementIteratorAssertions.h; sourceTree = "<group>"; };
</span><span class="cx">                 E401E0A31C3C0B8300F34D10 /* StyleChange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleChange.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -20945,8 +20945,8 @@
</span><span class="cx">                                 8F934D841189F1EE00508D5D /* JSMainThreadExecState.cpp */,
</span><span class="cx">                                 8F934D831189F1EE00508D5D /* JSMainThreadExecState.h */,
</span><span class="cx">                                 B56576E417DA599F00A56BDC /* JSMainThreadExecStateInstrumentation.h */,
</span><del>-                                E38838941BAD145F00D62EE3 /* JSModuleLoader.cpp */,
-                                E38838951BAD145F00D62EE3 /* JSModuleLoader.h */,
</del><ins>+                                E38838941BAD145F00D62EE3 /* ScriptModuleLoader.cpp */,
+                                E38838951BAD145F00D62EE3 /* ScriptModuleLoader.h */,
</ins><span class="cx">                                 C6F420A016B7164E0052A9F2 /* JSMutationCallback.cpp */,
</span><span class="cx">                                 C6F420A116B7164E0052A9F2 /* JSMutationCallback.h */,
</span><span class="cx">                                 7C91A38D1B498ABE003F9EFA /* JSNodeOrString.cpp */,
</span><span class="lines">@@ -25060,7 +25060,7 @@
</span><span class="cx">                                 E1ADEDDA0E76BD93004A1A5E /* JSMessagePort.h in Headers */,
</span><span class="cx">                                 41F584C7104652CB009CAA64 /* JSMessagePortCustom.h in Headers */,
</span><span class="cx">                                 2D6F3E951C1F85550061DBD4 /* JSMockPageOverlay.h in Headers */,
</span><del>-                                E38838991BAD145F00D62EE3 /* JSModuleLoader.h in Headers */,
</del><ins>+                                E38838991BAD145F00D62EE3 /* ScriptModuleLoader.h in Headers */,
</ins><span class="cx">                                 A86629D109DA2B48009633A5 /* JSMouseEvent.h in Headers */,
</span><span class="cx">                                 C6F420A316B7164E0052A9F2 /* JSMutationCallback.h in Headers */,
</span><span class="cx">                                 65DF31FC09D1CC60000BE325 /* JSMutationEvent.h in Headers */,
</span><span class="lines">@@ -25525,6 +25525,7 @@
</span><span class="cx">                                 CE1252411A16B1B600864480 /* MediaPlayerSPI.h in Headers */,
</span><span class="cx">                                 52E2CAFC19FF0207001EEB4F /* MediaProducer.h in Headers */,
</span><span class="cx">                                 4E19592A0A39DACC00220FE5 /* MediaQuery.h in Headers */,
</span><ins>+                                E38838991BAD145F00D62EE3 /* ScriptModuleLoader.h in Headers */,
</ins><span class="cx">                                 4E19592C0A39DACC00220FE5 /* MediaQueryEvaluator.h in Headers */,
</span><span class="cx">                                 4E19592E0A39DACC00220FE5 /* MediaQueryExp.h in Headers */,
</span><span class="cx">                                 D3A94A39122DABAC00A37BBC /* MediaQueryList.h in Headers */,
</span><span class="lines">@@ -28737,7 +28738,7 @@
</span><span class="cx">                                 410B7E721045FAB000D8224F /* JSMessageEventCustom.cpp in Sources */,
</span><span class="cx">                                 E1ADEDDB0E76BD93004A1A5E /* JSMessagePort.cpp in Sources */,
</span><span class="cx">                                 E1ADED470E76B8DD004A1A5E /* JSMessagePortCustom.cpp in Sources */,
</span><del>-                                E38838981BAD145F00D62EE3 /* JSModuleLoader.cpp in Sources */,
</del><ins>+                                E38838981BAD145F00D62EE3 /* ScriptModuleLoader.cpp in Sources */,
</ins><span class="cx">                                 A86629D209DA2B48009633A5 /* JSMouseEvent.cpp in Sources */,
</span><span class="cx">                                 C6F420A216B7164E0052A9F2 /* JSMutationCallback.cpp in Sources */,
</span><span class="cx">                                 65DF31FB09D1CC60000BE325 /* JSMutationEvent.cpp in Sources */,
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCorebindingsjsJSBindingsAllInOnecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -107,7 +107,6 @@
</span><span class="cx"> #include "JSMessageChannelCustom.cpp"
</span><span class="cx"> #include "JSMessageEventCustom.cpp"
</span><span class="cx"> #include "JSMessagePortCustom.cpp"
</span><del>-#include "JSModuleLoader.cpp"
</del><span class="cx"> #include "JSMutationCallback.cpp"
</span><span class="cx"> #include "JSMutationObserverCustom.cpp"
</span><span class="cx"> #include "JSNamedNodeMapCustom.cpp"
</span><span class="lines">@@ -147,6 +146,7 @@
</span><span class="cx"> #include "ScriptCachedFrameData.cpp"
</span><span class="cx"> #include "ScriptController.cpp"
</span><span class="cx"> #include "ScriptGlobalObject.cpp"
</span><ins>+#include "ScriptModuleLoader.cpp"
</ins><span class="cx"> #include "ScriptState.cpp"
</span><span class="cx"> #include "SerializedScriptValue.cpp"
</span><span class="cx"> #include "WebCoreTypedArrayController.cpp"
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCorebindingsjsJSDOMWindowBasecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSDOMWindowBase.cpp (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSDOMWindowBase.cpp        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSDOMWindowBase.cpp        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #include "JSDOMGlobalObjectTask.h"
</span><span class="cx"> #include "JSDOMWindowCustom.h"
</span><span class="cx"> #include "JSMainThreadExecState.h"
</span><del>-#include "JSModuleLoader.h"
</del><span class="cx"> #include "JSNode.h"
</span><span class="cx"> #include "Language.h"
</span><span class="cx"> #include "Logging.h"
</span><span class="lines">@@ -39,6 +38,7 @@
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "RuntimeApplicationChecks.h"
</span><span class="cx"> #include "ScriptController.h"
</span><ins>+#include "ScriptModuleLoader.h"
</ins><span class="cx"> #include "SecurityOrigin.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "WebCoreJSClientData.h"
</span><span class="lines">@@ -323,29 +323,29 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><del>-JSC::JSInternalPromise* JSDOMWindowBase::moduleLoaderResolve(JSC::JSGlobalObject* globalObject, JSC::ExecState* exec, JSC::JSModuleLoader* moduleLoader, JSC::JSValue moduleName, JSC::JSValue importerModuleKey)
</del><ins>+JSC::JSInternalPromise* JSDOMWindowBase::moduleLoaderResolve(JSC::JSGlobalObject* globalObject, JSC::ExecState* exec, JSC::JSModuleLoader* moduleLoader, JSC::JSValue moduleName, JSC::JSValue importerModuleKey, JSC::JSValue initiator)
</ins><span class="cx"> {
</span><span class="cx"> JSDOMWindowBase* thisObject = JSC::jsCast<JSDOMWindowBase*>(globalObject);
</span><span class="cx"> if (RefPtr<Document> document = thisObject->wrapped().document())
</span><del>- return document->moduleLoader()->resolve(globalObject, exec, moduleLoader, moduleName, importerModuleKey);
</del><ins>+ return document->moduleLoader()->resolve(globalObject, exec, moduleLoader, moduleName, importerModuleKey, initiator);
</ins><span class="cx"> JSC::JSInternalPromiseDeferred* deferred = JSC::JSInternalPromiseDeferred::create(exec, globalObject);
</span><span class="cx"> return deferred->reject(exec, jsUndefined());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-JSC::JSInternalPromise* JSDOMWindowBase::moduleLoaderFetch(JSC::JSGlobalObject* globalObject, JSC::ExecState* exec, JSC::JSModuleLoader* moduleLoader, JSC::JSValue moduleKey)
</del><ins>+JSC::JSInternalPromise* JSDOMWindowBase::moduleLoaderFetch(JSC::JSGlobalObject* globalObject, JSC::ExecState* exec, JSC::JSModuleLoader* moduleLoader, JSC::JSValue moduleKey, JSC::JSValue initiator)
</ins><span class="cx"> {
</span><span class="cx"> JSDOMWindowBase* thisObject = JSC::jsCast<JSDOMWindowBase*>(globalObject);
</span><span class="cx"> if (RefPtr<Document> document = thisObject->wrapped().document())
</span><del>- return document->moduleLoader()->fetch(globalObject, exec, moduleLoader, moduleKey);
</del><ins>+ return document->moduleLoader()->fetch(globalObject, exec, moduleLoader, moduleKey, initiator);
</ins><span class="cx"> JSC::JSInternalPromiseDeferred* deferred = JSC::JSInternalPromiseDeferred::create(exec, globalObject);
</span><span class="cx"> return deferred->reject(exec, jsUndefined());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-JSC::JSValue JSDOMWindowBase::moduleLoaderEvaluate(JSC::JSGlobalObject* globalObject, JSC::ExecState* exec, JSC::JSModuleLoader* moduleLoader, JSC::JSValue moduleKey, JSC::JSValue moduleRecord)
</del><ins>+JSC::JSValue JSDOMWindowBase::moduleLoaderEvaluate(JSC::JSGlobalObject* globalObject, JSC::ExecState* exec, JSC::JSModuleLoader* moduleLoader, JSC::JSValue moduleKey, JSC::JSValue moduleRecord, JSC::JSValue initiator)
</ins><span class="cx"> {
</span><span class="cx"> JSDOMWindowBase* thisObject = JSC::jsCast<JSDOMWindowBase*>(globalObject);
</span><span class="cx"> if (RefPtr<Document> document = thisObject->wrapped().document())
</span><del>- return document->moduleLoader()->evaluate(globalObject, exec, moduleLoader, moduleKey, moduleRecord);
</del><ins>+ return document->moduleLoader()->evaluate(globalObject, exec, moduleLoader, moduleKey, moduleRecord, initiator);
</ins><span class="cx"> return JSC::jsUndefined();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCorebindingsjsJSDOMWindowBaseh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSDOMWindowBase.h (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSDOMWindowBase.h        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSDOMWindowBase.h        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -78,9 +78,9 @@
</span><span class="cx"> JSC::WatchpointSet m_windowCloseWatchpoints;
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- static JSC::JSInternalPromise* moduleLoaderResolve(JSC::JSGlobalObject*, JSC::ExecState*, JSC::JSModuleLoader*, JSC::JSValue, JSC::JSValue);
- static JSC::JSInternalPromise* moduleLoaderFetch(JSC::JSGlobalObject*, JSC::ExecState*, JSC::JSModuleLoader*, JSC::JSValue);
- static JSC::JSValue moduleLoaderEvaluate(JSC::JSGlobalObject*, JSC::ExecState*, JSC::JSModuleLoader*, JSC::JSValue, JSC::JSValue);
</del><ins>+ static JSC::JSInternalPromise* moduleLoaderResolve(JSC::JSGlobalObject*, JSC::ExecState*, JSC::JSModuleLoader*, JSC::JSValue, JSC::JSValue, JSC::JSValue);
+ static JSC::JSInternalPromise* moduleLoaderFetch(JSC::JSGlobalObject*, JSC::ExecState*, JSC::JSModuleLoader*, JSC::JSValue, JSC::JSValue);
+ static JSC::JSValue moduleLoaderEvaluate(JSC::JSGlobalObject*, JSC::ExecState*, JSC::JSModuleLoader*, JSC::JSValue, JSC::JSValue, JSC::JSValue);
</ins><span class="cx">
</span><span class="cx"> RefPtr<DOMWindow> m_wrapped;
</span><span class="cx"> JSDOMWindowShell* m_shell;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCorebindingsjsJSMainThreadExecStateh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSMainThreadExecState.h (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSMainThreadExecState.h        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSMainThreadExecState.h        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx"> * Copyright (C) 2010 Google Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2016 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -92,6 +93,30 @@
</span><span class="cx"> task.run(exec);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ static JSC::JSInternalPromise* loadModule(JSC::ExecState* exec, const String& moduleName, JSC::JSValue initiator)
+ {
+ JSMainThreadExecState currentState(exec);
+ return JSC::loadModule(exec, moduleName, initiator);
+ }
+
+ static JSC::JSInternalPromise* loadModule(JSC::ExecState* exec, const JSC::SourceCode& sourceCode, JSC::JSValue initiator)
+ {
+ JSMainThreadExecState currentState(exec);
+ return JSC::loadModule(exec, sourceCode, initiator);
+ }
+
+ static JSC::JSValue linkAndEvaluateModule(JSC::ExecState* exec, const JSC::Identifier& moduleKey, JSC::JSValue initiator, NakedPtr<JSC::Exception>& returnedException)
+ {
+ JSMainThreadExecState currentState(exec);
+ JSC::JSValue returnValue = JSC::linkAndEvaluateModule(exec, moduleKey, initiator);
+ if (exec->hadException()) {
+ returnedException = exec->vm().exception();
+ exec->clearException();
+ return JSC::jsUndefined();
+ }
+ return returnValue;
+ }
+
</ins><span class="cx"> static InspectorInstrumentationCookie instrumentFunctionCall(ScriptExecutionContext*, JSC::CallType, const JSC::CallData&);
</span><span class="cx"> static InspectorInstrumentationCookie instrumentFunctionConstruct(ScriptExecutionContext*, JSC::ConstructType, const JSC::ConstructData&);
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCorebindingsjsJSModuleLoadercpp"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSModuleLoader.cpp (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSModuleLoader.cpp        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSModuleLoader.cpp        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -1,132 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "JSModuleLoader.h"
-
-#include "Document.h"
-#include "ExceptionCode.h"
-#include "Frame.h"
-#include "JSDOMBinding.h"
-#include <runtime/JSInternalPromiseDeferred.h>
-#include <runtime/JSModuleRecord.h>
-#include <runtime/JSString.h>
-#include <runtime/Symbol.h>
-
-namespace WebCore {
-
-JSModuleLoader::JSModuleLoader(Document& document)
- : m_document(document)
-{
-}
-
-JSC::JSInternalPromise* JSModuleLoader::resolve(JSC::JSGlobalObject* globalObject, JSC::ExecState* exec, JSC::JSModuleLoader*, JSC::JSValue moduleNameValue, JSC::JSValue importerModuleKey)
-{
- JSC::JSInternalPromiseDeferred* deferred = JSC::JSInternalPromiseDeferred::create(exec, globalObject);
-
- // We use a Symbol as a special purpose; It means this module is an inline module.
- // So there is no correct URL to retrieve the module source code. If the module name
- // value is a Symbol, it is used directly as a module key.
- //
- // FIXME: Using symbols for an inline module is a current implementation details of WebKit.
- // Once the spec of this part is specified, we will recast these part.
- if (moduleNameValue.isSymbol())
- return deferred->resolve(exec, moduleNameValue);
-
- if (!moduleNameValue.isString())
- return deferred->reject(exec, JSC::createTypeError(exec, "Module name is not Symbol or String."));
-
- String moduleName = asString(moduleNameValue)->value(exec);
-
- // Now, we consider the given moduleName as the same to the `import "..."` in the module code.
- // We use the completed URL as the unique module key.
- URL completedUrl;
-
- if (importerModuleKey.isSymbol())
- completedUrl = m_document.completeURL(moduleName);
- else if (importerModuleKey.isUndefined())
- completedUrl = m_document.completeURL(moduleName);
- else if (importerModuleKey.isString()) {
- URL importerModuleUrl(URL(), asString(importerModuleKey)->value(exec));
- if (!importerModuleUrl.isValid())
- return deferred->reject(exec, JSC::createTypeError(exec, "Importer module key is an invalid URL."));
- completedUrl = m_document.completeURL(moduleName, importerModuleUrl);
- } else
- return deferred->reject(exec, JSC::createTypeError(exec, "Importer module key is not Symbol or String."));
-
- if (!completedUrl.isValid())
- return deferred->reject(exec, JSC::createTypeError(exec, "Module name constructs an invalid URL."));
-
- return deferred->resolve(exec, jsString(exec, completedUrl.string()));
-}
-
-JSC::JSInternalPromise* JSModuleLoader::fetch(JSC::JSGlobalObject* globalObject, JSC::ExecState* exec, JSC::JSModuleLoader*, JSC::JSValue moduleKeyValue)
-{
- JSC::JSInternalPromiseDeferred* deferred = JSC::JSInternalPromiseDeferred::create(exec, globalObject);
-
- if (moduleKeyValue.isSymbol())
- return deferred->reject(exec, JSC::createTypeError(exec, "Symbol module key should be already fulfilled with the inlined resource."));
-
- if (!moduleKeyValue.isString())
- return deferred->reject(exec, JSC::createTypeError(exec, "Module key is not Symbol or String."));
-
- URL completedUrl(URL(), asString(moduleKeyValue)->value(exec));
- if (!completedUrl.isValid())
- return deferred->reject(exec, JSC::createTypeError(exec, "Module key is an invalid URL."));
-
- // FIXME: Implement the module fetcher.
-
- return deferred->promise();
-}
-
-JSC::JSValue JSModuleLoader::evaluate(JSC::JSGlobalObject*, JSC::ExecState* exec, JSC::JSModuleLoader*, JSC::JSValue moduleKeyValue, JSC::JSValue moduleRecordValue)
-{
- JSC::VM& vm = exec->vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- // FIXME: Currently, we only support JSModuleRecord.
- // Once the reflective part of the module loader is supported, we will handle arbitrary values.
- // https://whatwg.github.io/loader/#registry-prototype-provide
- JSC::JSModuleRecord* moduleRecord = JSC::jsDynamicCast<JSC::JSModuleRecord*>(moduleRecordValue);
- if (!moduleRecord)
- return JSC::jsUndefined();
-
- URL sourceUrl;
- if (moduleKeyValue.isSymbol())
- sourceUrl = m_document.url();
- else if (moduleKeyValue.isString())
- sourceUrl = URL(URL(), asString(moduleKeyValue)->value(exec));
- else
- return JSC::throwTypeError(exec, scope, ASCIILiteral("Module key is not Symbol or String."));
-
- if (!sourceUrl.isValid())
- return JSC::throwTypeError(exec, scope, ASCIILiteral("Module key is an invalid URL."));
-
- // FIXME: Implement evaluating module code.
-
- return JSC::jsUndefined();
-}
-
-}
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCorebindingsjsJSModuleLoaderh"></a>
<div class="delfile"><h4>Deleted: releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSModuleLoader.h (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSModuleLoader.h        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSModuleLoader.h        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -1,59 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include <runtime/JSCJSValue.h>
-#include <wtf/Noncopyable.h>
-
-namespace JSC {
-
-class ExecState;
-class JSGlobalObject;
-class JSInternalPromise;
-class JSModuleLoader;
-
-}
-
-namespace WebCore {
-
-class Document;
-
-class JSModuleLoader {
- WTF_MAKE_NONCOPYABLE(JSModuleLoader); WTF_MAKE_FAST_ALLOCATED;
-public:
- explicit JSModuleLoader(Document&);
-
- Document& document() { return m_document; }
-
- JSC::JSInternalPromise* resolve(JSC::JSGlobalObject*, JSC::ExecState*, JSC::JSModuleLoader*, JSC::JSValue moduleName, JSC::JSValue importerModuleKey);
- JSC::JSInternalPromise* fetch(JSC::JSGlobalObject*, JSC::ExecState*, JSC::JSModuleLoader*, JSC::JSValue moduleKey);
- JSC::JSValue evaluate(JSC::JSGlobalObject*, JSC::ExecState*, JSC::JSModuleLoader*, JSC::JSValue moduleKey, JSC::JSValue moduleRecord);
-
-private:
- Document& m_document;
-};
-
-} // namespace WebCore
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCorebindingsjsScriptModuleLoadercppfromrev205612releasesWebKitGTKwebkit214SourceWebCorebindingsjsJSModuleLoadercpp"></a>
<div class="copfile"><h4>Copied: releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/ScriptModuleLoader.cpp (from rev 205612, releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSModuleLoader.cpp) (0 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/ScriptModuleLoader.cpp         (rev 0)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/ScriptModuleLoader.cpp        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -0,0 +1,132 @@
</span><ins>+/*
+ * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ScriptModuleLoader.h"
+
+#include "Document.h"
+#include "ExceptionCode.h"
+#include "Frame.h"
+#include "JSDOMBinding.h"
+#include <runtime/JSInternalPromiseDeferred.h>
+#include <runtime/JSModuleRecord.h>
+#include <runtime/JSString.h>
+#include <runtime/Symbol.h>
+
+namespace WebCore {
+
+ScriptModuleLoader::ScriptModuleLoader(Document& document)
+ : m_document(document)
+{
+}
+
+JSC::JSInternalPromise* ScriptModuleLoader::resolve(JSC::JSGlobalObject* globalObject, JSC::ExecState* exec, JSC::JSModuleLoader*, JSC::JSValue moduleNameValue, JSC::JSValue importerModuleKey, JSC::JSValue)
+{
+ JSC::JSInternalPromiseDeferred* deferred = JSC::JSInternalPromiseDeferred::create(exec, globalObject);
+
+ // We use a Symbol as a special purpose; It means this module is an inline module.
+ // So there is no correct URL to retrieve the module source code. If the module name
+ // value is a Symbol, it is used directly as a module key.
+ //
+ // FIXME: Using symbols for an inline module is a current implementation details of WebKit.
+ // Once the spec of this part is specified, we will recast these part.
+ if (moduleNameValue.isSymbol())
+ return deferred->resolve(exec, moduleNameValue);
+
+ if (!moduleNameValue.isString())
+ return deferred->reject(exec, JSC::createTypeError(exec, "Module name is not Symbol or String."));
+
+ String moduleName = asString(moduleNameValue)->value(exec);
+
+ // Now, we consider the given moduleName as the same to the `import "..."` in the module code.
+ // We use the completed URL as the unique module key.
+ URL completedUrl;
+
+ if (importerModuleKey.isSymbol())
+ completedUrl = m_document.completeURL(moduleName);
+ else if (importerModuleKey.isUndefined())
+ completedUrl = m_document.completeURL(moduleName);
+ else if (importerModuleKey.isString()) {
+ URL importerModuleUrl(URL(), asString(importerModuleKey)->value(exec));
+ if (!importerModuleUrl.isValid())
+ return deferred->reject(exec, JSC::createTypeError(exec, "Importer module key is an invalid URL."));
+ completedUrl = m_document.completeURL(moduleName, importerModuleUrl);
+ } else
+ return deferred->reject(exec, JSC::createTypeError(exec, "Importer module key is not Symbol or String."));
+
+ if (!completedUrl.isValid())
+ return deferred->reject(exec, JSC::createTypeError(exec, "Module name constructs an invalid URL."));
+
+ return deferred->resolve(exec, jsString(exec, completedUrl.string()));
+}
+
+JSC::JSInternalPromise* ScriptModuleLoader::fetch(JSC::JSGlobalObject* globalObject, JSC::ExecState* exec, JSC::JSModuleLoader*, JSC::JSValue moduleKeyValue, JSC::JSValue)
+{
+ JSC::JSInternalPromiseDeferred* deferred = JSC::JSInternalPromiseDeferred::create(exec, globalObject);
+
+ if (moduleKeyValue.isSymbol())
+ return deferred->reject(exec, JSC::createTypeError(exec, "Symbol module key should be already fulfilled with the inlined resource."));
+
+ if (!moduleKeyValue.isString())
+ return deferred->reject(exec, JSC::createTypeError(exec, "Module key is not Symbol or String."));
+
+ URL completedUrl(URL(), asString(moduleKeyValue)->value(exec));
+ if (!completedUrl.isValid())
+ return deferred->reject(exec, JSC::createTypeError(exec, "Module key is an invalid URL."));
+
+ // FIXME: Implement the module fetcher.
+
+ return deferred->promise();
+}
+
+JSC::JSValue ScriptModuleLoader::evaluate(JSC::JSGlobalObject*, JSC::ExecState* exec, JSC::JSModuleLoader*, JSC::JSValue moduleKeyValue, JSC::JSValue moduleRecordValue, JSC::JSValue)
+{
+ JSC::VM& vm = exec->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+
+ // FIXME: Currently, we only support JSModuleRecord.
+ // Once the reflective part of the module loader is supported, we will handle arbitrary values.
+ // https://whatwg.github.io/loader/#registry-prototype-provide
+ JSC::JSModuleRecord* moduleRecord = JSC::jsDynamicCast<JSC::JSModuleRecord*>(moduleRecordValue);
+ if (!moduleRecord)
+ return JSC::jsUndefined();
+
+ URL sourceUrl;
+ if (moduleKeyValue.isSymbol())
+ sourceUrl = m_document.url();
+ else if (moduleKeyValue.isString())
+ sourceUrl = URL(URL(), asString(moduleKeyValue)->value(exec));
+ else
+ return JSC::throwTypeError(exec, scope, ASCIILiteral("Module key is not Symbol or String."));
+
+ if (!sourceUrl.isValid())
+ return JSC::throwTypeError(exec, scope, ASCIILiteral("Module key is an invalid URL."));
+
+ // FIXME: Implement evaluating module code.
+
+ return JSC::jsUndefined();
+}
+
+}
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCorebindingsjsScriptModuleLoaderhfromrev205612releasesWebKitGTKwebkit214SourceWebCorebindingsjsJSModuleLoaderh"></a>
<div class="copfile"><h4>Copied: releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/ScriptModuleLoader.h (from rev 205612, releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/JSModuleLoader.h) (0 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/ScriptModuleLoader.h         (rev 0)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/bindings/js/ScriptModuleLoader.h        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <runtime/JSCJSValue.h>
+#include <wtf/Noncopyable.h>
+
+namespace JSC {
+
+class ExecState;
+class JSGlobalObject;
+class JSInternalPromise;
+class JSModuleLoader;
+
+}
+
+namespace WebCore {
+
+class Document;
+
+class ScriptModuleLoader {
+ WTF_MAKE_NONCOPYABLE(ScriptModuleLoader); WTF_MAKE_FAST_ALLOCATED;
+public:
+ explicit ScriptModuleLoader(Document&);
+
+ Document& document() { return m_document; }
+
+ JSC::JSInternalPromise* resolve(JSC::JSGlobalObject*, JSC::ExecState*, JSC::JSModuleLoader*, JSC::JSValue moduleName, JSC::JSValue importerModuleKey, JSC::JSValue initiator);
+ JSC::JSInternalPromise* fetch(JSC::JSGlobalObject*, JSC::ExecState*, JSC::JSModuleLoader*, JSC::JSValue moduleKey, JSC::JSValue initiator);
+ JSC::JSValue evaluate(JSC::JSGlobalObject*, JSC::ExecState*, JSC::JSModuleLoader*, JSC::JSValue moduleKey, JSC::JSValue moduleRecord, JSC::JSValue initiator);
+
+private:
+ Document& m_document;
+};
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/Document.cpp (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/Document.cpp        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/Document.cpp        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -103,7 +103,6 @@
</span><span class="cx"> #include "InspectorInstrumentation.h"
</span><span class="cx"> #include "JSCustomElementInterface.h"
</span><span class="cx"> #include "JSLazyEventListener.h"
</span><del>-#include "JSModuleLoader.h"
</del><span class="cx"> #include "KeyboardEvent.h"
</span><span class="cx"> #include "Language.h"
</span><span class="cx"> #include "LoaderStrategy.h"
</span><span class="lines">@@ -153,6 +152,7 @@
</span><span class="cx"> #include "SchemeRegistry.h"
</span><span class="cx"> #include "ScopedEventQueue.h"
</span><span class="cx"> #include "ScriptController.h"
</span><ins>+#include "ScriptModuleLoader.h"
</ins><span class="cx"> #include "ScriptRunner.h"
</span><span class="cx"> #include "ScriptSourceCode.h"
</span><span class="cx"> #include "ScrollingCoordinator.h"
</span><span class="lines">@@ -480,7 +480,7 @@
</span><span class="cx"> , m_startTime(std::chrono::steady_clock::now())
</span><span class="cx"> , m_overMinimumLayoutThreshold(false)
</span><span class="cx"> , m_scriptRunner(std::make_unique<ScriptRunner>(*this))
</span><del>- , m_moduleLoader(std::make_unique<JSModuleLoader>(*this))
</del><ins>+ , m_moduleLoader(std::make_unique<ScriptModuleLoader>(*this))
</ins><span class="cx"> , m_xmlVersion(ASCIILiteral("1.0"))
</span><span class="cx"> , m_xmlStandalone(StandaloneUnspecified)
</span><span class="cx"> , m_hasXMLDeclaration(false)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/Document.h (205612 => 205613)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/Document.h        2016-09-08 09:16:52 UTC (rev 205612)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/dom/Document.h        2016-09-08 09:40:13 UTC (rev 205613)
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx"> class LayoutPoint;
</span><span class="cx"> class LayoutRect;
</span><span class="cx"> class LiveNodeList;
</span><del>-class JSModuleLoader;
</del><ins>+class ScriptModuleLoader;
</ins><span class="cx"> class JSNode;
</span><span class="cx"> class Locale;
</span><span class="cx"> class Location;
</span><span class="lines">@@ -133,6 +133,7 @@
</span><span class="cx"> class MediaPlaybackTargetClient;
</span><span class="cx"> class MediaQueryList;
</span><span class="cx"> class MediaQueryMatcher;
</span><ins>+class ScriptModuleLoader;
</ins><span class="cx"> class MouseEventWithHitTestResults;
</span><span class="cx"> class NamedFlowCollection;
</span><span class="cx"> class NodeFilter;
</span><span class="lines">@@ -947,7 +948,7 @@
</span><span class="cx"> Document& topDocument() const;
</span><span class="cx">
</span><span class="cx"> ScriptRunner* scriptRunner() { return m_scriptRunner.get(); }
</span><del>- JSModuleLoader* moduleLoader() { return m_moduleLoader.get(); }
</del><ins>+ ScriptModuleLoader* moduleLoader() { return m_moduleLoader.get(); }
</ins><span class="cx">
</span><span class="cx"> HTMLScriptElement* currentScript() const { return !m_currentScriptStack.isEmpty() ? m_currentScriptStack.last().get() : nullptr; }
</span><span class="cx"> void pushCurrentScript(HTMLScriptElement*);
</span><span class="lines">@@ -1551,7 +1552,7 @@
</span><span class="cx"> bool m_overMinimumLayoutThreshold;
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<ScriptRunner> m_scriptRunner;
</span><del>- std::unique_ptr<JSModuleLoader> m_moduleLoader;
</del><ins>+ std::unique_ptr<ScriptModuleLoader> m_moduleLoader;
</ins><span class="cx">
</span><span class="cx"> Vector<RefPtr<HTMLScriptElement>> m_currentScriptStack;
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>