@@ -2893,7 +2893,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
2893
2893
<li>The <dfn data-x-href="https://tc39.es/ecma262/#sec-detacharraybuffer">DetachArrayBuffer</dfn> abstract operation</li>
2894
2894
<li>The <dfn data-x-href="https://tc39.es/ecma262/#sec-enumerableownproperties">EnumerableOwnProperties</dfn> abstract operation</li>
2895
2895
<li>The <dfn data-x-href="https://tc39.es/ecma262/#sec-finishdynamicimport">FinishDynamicImport</dfn> abstract operation</li>
2896
- <li>The <dfn data-x-href="https://ci.tc39.es/preview/tc39/ecma262/pull/2905/#sec-FinishLoadImportedModule">FinishLoadImportedModule </dfn> abstract operation</li>
2896
+ <li>The <dfn data-x-href="https://ci.tc39.es/preview/tc39/ecma262/pull/2905/#sec-FinishLoadingImportedModule">FinishLoadingImportedModule </dfn> abstract operation</li>
2897
2897
<li>The <dfn data-x="js-OrdinaryFunctionCreate" data-x-href="https://tc39.es/ecma262/#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</dfn> abstract operation</li>
2898
2898
<li>The <dfn data-x="js-Get" data-x-href="https://tc39.es/ecma262/#sec-get-o-p">Get</dfn> abstract operation</li>
2899
2899
<li>The <dfn data-x-href="https://tc39.es/ecma262/#sec-getactivescriptormodule">GetActiveScriptOrModule</dfn> abstract operation</li>
@@ -93319,7 +93319,7 @@ document.querySelector("button").addEventListener("click", bound);
93319
93319
<p>This diagram illustrates how these algorithms relate to the ones above, as well as to each
93320
93320
other:</p>
93321
93321
93322
- <svg id="module-script-fetching-diagram" viewBox="0 0 1131 256" style="width: 100%; " role="img" aria-label="Fetch an external module script, fetch a modulepreload module script graph, fetch an inline module script graph, and fetch a module worker script graph all call fetch the descendants of and link a module script.">
93322
+ <svg id="module-script-fetching-diagram" viewBox="0 0 941 256" style="width: 80%; max-width: 1024px " role="img" aria-label="Fetch an external module script, fetch a modulepreload module script graph, fetch an inline module script graph, and fetch a module worker script graph all call fetch the descendants of and link a module script.">
93323
93323
<style>
93324
93324
#module-script-fetching-diagram rect {
93325
93325
stroke: black;
@@ -93355,45 +93355,45 @@ document.querySelector("button").addEventListener("click", bound);
93355
93355
</g>
93356
93356
<path d="M90.5,50.5 L470.5,140.5" marker-end="url(#module-script-fetching-diagram-arrow)"/>
93357
93357
93358
- <g transform="translate(380 .5,0.5)" class="caller">
93358
+ <g transform="translate(190 .5,0.5)" class="caller">
93359
93359
<rect width="180" height="50"/>
93360
93360
<foreignObject width="180" height="50">
93361
93361
<span xmlns="http://www.w3.org/1999/xhtml">fetch a modulepreload module script graph</span>
93362
93362
</foreignObject>
93363
93363
</g>
93364
- <path d="M470 .5,50.5 L470.5,140.5" marker-end="url(#module-script-fetching-diagram-arrow)"/>
93364
+ <path d="M280 .5,50.5 L470.5,140.5" marker-end="url(#module-script-fetching-diagram-arrow)"/>
93365
93365
93366
- <g transform="translate(570 .5,0.5)" class="caller">
93366
+ <g transform="translate(380 .5,0.5)" class="caller">
93367
93367
<rect width="180" height="50"/>
93368
93368
<foreignObject width="180" height="50">
93369
93369
<span xmlns="http://www.w3.org/1999/xhtml">fetch an inline module script graph</span>
93370
93370
</foreignObject>
93371
93371
</g>
93372
- <path d="M660 .5,50.5 L470.5,140.5" marker-end="url(#module-script-fetching-diagram-arrow)"/>
93372
+ <path d="M470 .5,50.5 L470.5,140.5" marker-end="url(#module-script-fetching-diagram-arrow)"/>
93373
93373
93374
- <g transform="translate(760 .5,0.5)" class="caller">
93374
+ <g transform="translate(570 .5,0.5)" class="caller">
93375
93375
<rect width="180" height="50"/>
93376
93376
<foreignObject width="180" height="50">
93377
93377
<span xmlns="http://www.w3.org/1999/xhtml">fetch a module worker script graph</span>
93378
93378
</foreignObject>
93379
93379
</g>
93380
- <path d="M850 .5,50.5 L945 .5,70.5" marker-end="url(#module-script-fetching-diagram-arrow)"/>
93380
+ <path d="M660 .5,50.5 L755 .5,70.5" marker-end="url(#module-script-fetching-diagram-arrow)"/>
93381
93381
93382
- <g transform="translate(950 .5,0.5)" class="caller">
93382
+ <g transform="translate(760 .5,0.5)" class="caller">
93383
93383
<rect width="180" height="50"/>
93384
93384
<foreignObject width="180" height="50">
93385
93385
<span xmlns="http://www.w3.org/1999/xhtml">fetch a worklet script graph</span>
93386
93386
</foreignObject>
93387
93387
</g>
93388
- <path d="M1040 .5,50.5 L945 .5,70.5" marker-end="url(#module-script-fetching-diagram-arrow)"/>
93388
+ <path d="M850 .5,50.5 L755 .5,70.5" marker-end="url(#module-script-fetching-diagram-arrow)"/>
93389
93389
93390
- <g transform="translate(855 .5,70.5)" class="caller">
93390
+ <g transform="translate(665 .5,70.5)" class="caller">
93391
93391
<rect width="180" height="50"/>
93392
93392
<foreignObject width="180" height="50">
93393
93393
<span xmlns="http://www.w3.org/1999/xhtml">fetch a worklet/module worker script graph</span>
93394
93394
</foreignObject>
93395
93395
</g>
93396
- <path d="M945 .5,120.5 L470.5,140.5" marker-end="url(#module-script-fetching-diagram-arrow)"/>
93396
+ <path d="M755 .5,120.5 L470.5,140.5" marker-end="url(#module-script-fetching-diagram-arrow)"/>
93397
93397
93398
93398
<g transform="translate(260.5,140.5)" class="subalgorithm">
93399
93399
<rect width="420" height="25"/>
@@ -93471,21 +93471,6 @@ document.querySelector("button").addEventListener("click", bound);
93471
93471
<p class="note">This step will recursively load all the module transitive dependencies.</p>
93472
93472
</li>
93473
93473
93474
- <li>
93475
- <p><span>Upon rejection</span> of <var>loading promise</var>, run the
93476
- following steps:</p>
93477
-
93478
- <ol>
93479
- <li><p>If <var>state</var>.[[ParseError]] is not null, set <var>module script</var>'s <span
93480
- data-x="concept-script-error-to-rethrow">error to rethrow</span> to
93481
- <var>state</var>.[[ParseError]] and run <var>onComplete</var> given <var>module
93482
- script</var>.</p></li>
93483
-
93484
- <!-- loading error -->
93485
- <li><p>Otherwise, run <var>onComplete</var> give null.</p></li>
93486
- </ol>
93487
- </li>
93488
-
93489
93474
<li>
93490
93475
<p><span>Upon fulfillment</span> of <var>loading promise</var>, run the following steps:</p>
93491
93476
@@ -93496,13 +93481,32 @@ document.querySelector("button").addEventListener("click", bound);
93496
93481
<p class="note">This step will recursively call <span data-x="js-Link">Link</span> on all of
93497
93482
the module's unlinked dependencies.</p>
93498
93483
93499
- <p>If this throws an exception, set <var>module script</var>'s <span
93484
+ <p>If this throws an exception, catch it, and set <var>module script</var>'s <span
93500
93485
data-x="concept-script-error-to-rethrow">error to rethrow</span> to that exception.</p>
93501
93486
</li>
93502
93487
93503
93488
<li><p>Run <var>onComplete</var> given <var>module script</var>.</p></li>
93504
93489
</ol>
93505
93490
</li>
93491
+
93492
+ <li>
93493
+ <p><span>Upon rejection</span> of <var>loading promise</var>, run the
93494
+ following steps:</p>
93495
+
93496
+ <ol>
93497
+ <li><p>If <var>state</var>.[[ParseError]] is not null, set <var>module script</var>'s <span
93498
+ data-x="concept-script-error-to-rethrow">error to rethrow</span> to
93499
+ <var>state</var>.[[ParseError]] and run <var>onComplete</var> given <var>module
93500
+ script</var>.</p></li>
93501
+
93502
+ <li>
93503
+ <p>Otherwise, run <var>onComplete</var> given null.</p>
93504
+
93505
+ <p class="note"><var>state</var>.[[ParseError]] is null when <var>loading promise</var> is
93506
+ rejected due to a loading error.</p>
93507
+ </li>
93508
+ </ol>
93509
+ </li>
93506
93510
</ol>
93507
93511
93508
93512
<p>To <dfn>fetch a single module script</dfn>, given a <var>url</var>, a <var>fetch client
@@ -93842,7 +93846,7 @@ document.querySelector("button").addEventListener("click", bound);
93842
93846
<p>Run the steps to <span>synchronously replace the rules of a <code>CSSStyleSheet</code></span>
93843
93847
on <var>sheet</var> given <var>source</var>.</p>
93844
93848
93845
- <p>If this throws an exception, set <var>script</var>'s <span
93849
+ <p>If this throws an exception, catch it, and set <var>script</var>'s <span
93846
93850
data-x="concept-script-parse-error">parse error</span> to that exception, and return
93847
93851
<var>script</var>.</p>
93848
93852
@@ -93877,7 +93881,7 @@ document.querySelector("button").addEventListener("click", bound);
93877
93881
<li>
93878
93882
<p>Let <var>result</var> be <span>ParseJSONModule</span>(<var>source</var>).</p>
93879
93883
93880
- <p>If this throws an exception, set <var>script</var>'s <span
93884
+ <p>If this throws an exception, catch it, and set <var>script</var>'s <span
93881
93885
data-x="concept-script-parse-error">parse error</span> to that exception, and return
93882
93886
<var>script</var>.</p>
93883
93887
</li>
@@ -95013,13 +95017,19 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
95013
95017
».</p></li>
95014
95018
</ol>
95015
95019
95016
- <h6><dfn>HostLoadImportedModule</dfn>(<var>referrer</var>, <var>moduleRequest </var>,
95017
- <var>loadState</var>, <var>payload</var>)</h6>
95020
+ <h6 id="the-hostloadimportedmodule-implementation" ><dfn>HostLoadImportedModule</dfn>(<var>referrer</var>,
95021
+ <var>moduleRequest</var>, <var> loadState</var>, <var>payload</var>)</h6>
95018
95022
95019
95023
<p>JavaScript contains an <span>implementation-defined</span> <span
95020
95024
data-x="js-HostLoadImportedModule">HostLoadImportedModule</span> abstract operation. User agents
95021
95025
must use the following implementation: <ref spec=JAVASCRIPT></p>
95022
95026
95027
+ <p class="note">This specification expects the second parameter to be a <span>ModuleRequest
95028
+ Record</span>, instead of a string as specified by ECMA-262. This is under the assumption that the
95029
+ <cite>import assertions</cite> proposal, when updated to use <span>HostLoadImportedModule</span>
95030
+ instead of the previous module loading hooks, will update the abstract operation passing a
95031
+ <span>ModuleRequest Record</span>. <ref spec=JSIMPORTASSERTIONS></p>
95032
+
95023
95033
<ol>
95024
95034
<li><p>Let <var>settings object</var> be the <span>current settings object</span>.</p></li>
95025
95035
@@ -95028,16 +95038,14 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
95028
95038
object</span> implements <code>WorkletGlobalScope</code> or <code>ServiceWorkerGlobalScope</code>
95029
95039
and <var>loadState</var> is undefined, then:</p>
95030
95040
95031
- <p class="note">
95032
- <var>loadState</var> is undefined when the current fetching process has been initiated by a
95033
- dynamic <code data-x="">import()</code> call.
95034
- </p>
95041
+ <p class="note"><var>loadState</var> is undefined when the current fetching process has been
95042
+ initiated by a dynamic <code>import()</code> call.</p>
95035
95043
95036
95044
<ol>
95037
- <li><p>Let <var>completion</var> be Completion { [[Type]]: throw, [[Value]]: a new
95045
+ <li><p>Let <var>completion</var> be the <span> Completion Record</span> { [[Type]]: throw, [[Value]]: a new
95038
95046
<code>TypeError</code>, [[Target]]: empty }.</p></li>
95039
95047
95040
- <li><p>Perform <span>FinishLoadImportedModule </span>(<var>referrer</var>,
95048
+ <li><p>Perform <span>FinishLoadingImportedModule </span>(<var>referrer</var>,
95041
95049
<var>moduleRequest</var>, <var>payload</var>, <var>completion</var>).</p></li>
95042
95050
95043
95051
<li><p>Return.</p></li>
@@ -95070,7 +95078,7 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
95070
95078
<var>referencing script</var>'s <span data-x="concept-script-script-fetch-options">fetch
95071
95079
options</span>.</p></li>
95072
95080
95073
- <li><p>Assert: Neither <var>base URL</var> nor <var>fetch options</var> is null, as
95081
+ <li><p>Assert: neither <var>base URL</var> nor <var>fetch options</var> is null, as
95074
95082
<var>referencing script</var> is a <span>classic script</span> or a <span>JavaScript module
95075
95083
script</span>.</p></li>
95076
95084
@@ -95099,49 +95107,49 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
95099
95107
</div>
95100
95108
</li>
95101
95109
95102
- <li><p>Let <var>destination</var> be " script".</p></li>
95110
+ <li><p>Let <var>destination</var> be <code data-x="">" script"</code> .</p></li>
95103
95111
95104
- <li><p>If <var>loadState</var> is not undefined, set <var>destination</var> to
95112
+ <li><p>If <var>loadState</var> is not undefined, then set <var>destination</var> to
95105
95113
<var>loadState</var>.[[Destination]].</p></li>
95106
95114
95107
95115
<li>
95108
95116
<p><span>Fetch a single imported module script</span> given <var>settings object</var>,
95109
95117
<var>base URL</var>, <var>destination</var>, <var>fetch options</var>, <var>fetch
95110
- referrer</var>, <var>moduleRequest</var>, and with the following steps given <var>module
95111
- script</var>:</p>
95118
+ referrer</var>, <var>moduleRequest</var>, and <var>onSingleFetchComplete</var> as defined below.
95119
+ If <var>loadState</var> is not undefined and <var>loadState</var>.[[PerformTheFetch]] is not
95120
+ null, pass <var>loadState</var>.[[PerformTheFetch]] along as well.</p>
95121
+
95122
+ <p><var>onSingleFetchComplete</var> given <var>moduleScript</var> is the following
95123
+ algorithm:</p>
95112
95124
95113
95125
<ol>
95114
- <li><p>If <var>module script</var> is null, then let <var>completion</var> be Completion {
95115
- [[Type]]: throw, [[Value]]: a new <code>TypeError</code>, [[Target]]: empty }.</p></li>
95126
+ <li><p>If <var>moduleScript</var> is null, then let <var>completion</var> be the
95127
+ <span>Completion Record</span> { [[Type]]: throw, [[Value]]: a new <code>TypeError</code>,
95128
+ [[Target]]: empty }.</p></li>
95116
95129
95117
95130
<li>
95118
- <p>Otherwise, if <var>module script </var>'s <span data-x="concept-script-parse-error">parse
95131
+ <p>Otherwise, if <var>moduleScript </var>'s <span data-x="concept-script-parse-error">parse
95119
95132
error</span> is not null, then:</p>
95120
95133
95121
95134
<ol>
95122
- <li><p>Let <var>parse error </var> be <var>module script </var>'s <span
95135
+ <li><p>Let <var>parseError </var> be <var>moduleScript </var>'s <span
95123
95136
data-x="concept-script-parse-error">parse error</span>.</p></li>
95124
95137
95125
- <li><p>Let <var>completion</var> be Completion { [[Type]]: throw, [[Value]]: <var>parse
95126
- error </var>, [[Target]]: empty }.</p></li>
95138
+ <li><p>Let <var>completion</var> be the <span> Completion Record</span> { [[Type]]: throw,
95139
+ [[Value]]: <var>parseError </var>, [[Target]]: empty }.</p></li>
95127
95140
95128
95141
<li><p>If <var>loadState</var> is not undefined and <var>loadState</var>.[[ParseError]] is
95129
- null, set <var>loadState</var>.[[ParseError]] to <var>parse error </var>.</p></li>
95142
+ null, set <var>loadState</var>.[[ParseError]] to <var>parseError </var>.</p></li>
95130
95143
</ol>
95131
95144
</li>
95132
95145
95133
- <li><p>Otherwise, let <var>completion</var> be Completion { [[Type]]: normal, [[Value ]]:
95134
- <var>result</var>'s <span data-x="concept-script-record">record</span>, [[Target]]: empty
95135
- }.</p></li>
95146
+ <li><p>Otherwise, let <var>completion</var> be the <span> Completion Record</span> { [[Type]]:
95147
+ normal, [[Value]]: <var>result</var>'s <span data-x="concept-script-record">record</span>,
95148
+ [[Target]]: empty }.</p></li>
95136
95149
95137
- <li><p>Perform <span>FinishLoadImportedModule </span>(<var>referrer</var>,
95150
+ <li><p>Perform <span>FinishLoadingImportedModule </span>(<var>referrer</var>,
95138
95151
<var>moduleRequest</var>, <var>payload</var>, <var>completion</var>).</p></li>
95139
95152
</ol>
95140
-
95141
- <p>If <var>loadState</var> is not undefined and <var>loadState</var>.[[PerformTheFetch]] is not
95142
- null, pass <var>loadState</var>.[[PerformTheFetch]] as <span>fetch a single imported module
95143
- script</span>'s custom <span data-x="fetching-scripts-perform-fetch">perform the fetch</span>
95144
- steps.</p>
95145
95153
</li>
95146
95154
</ol>
95147
95155
0 commit comments