@@ -86746,24 +86746,24 @@ interface <dfn>NavigatorOnLine</dfn> {
86746
86746
86747
86747
</dd>
86748
86748
86749
- <dt>An <dfn data-x="concept-module-script-instantiation- state">instantiation state</dfn></dt>
86749
+ <dt>A <dfn data-x="concept-module-script-state">state</dfn></dt>
86750
86750
86751
86751
<dd>
86752
86752
86753
86753
<p>One of "<code data-x="">uninstantiated</code>", "<code data-x="">errored</code>", or "<code
86754
86754
data-x="">instantiated</code>", used to prevent reinvocation of <span
86755
86755
data-x="js-ModuleDeclarationInstantiation">ModuleDeclarationInstantiation</span> on modules that
86756
- failed to instantiate previously.</p>
86756
+ failed to instantiate previously, and to ensure errors during parsing or instantiation are
86757
+ remembered and propagated correctly.</p>
86757
86758
86758
86759
</dd>
86759
86760
86760
- <dt>An <dfn data-x="concept-module-script-instantiation- error">instantiation error</dfn></dt>
86761
+ <dt>An <dfn data-x="concept-module-script-error">error</dfn></dt>
86761
86762
86762
86763
<dd>
86763
86764
86764
86765
<p>A JavaScript value, which has meaning only if the <span
86765
- data-x="concept-module-script-instantiation-state">instantiation state</span> is "<code
86766
- data-x="">errored</code>".</p>
86766
+ data-x="concept-module-script-state">state</span> is "<code data-x="">errored</code>".</p>
86767
86767
86768
86768
</dd>
86769
86769
@@ -87230,49 +87230,41 @@ interface <dfn>NavigatorOnLine</dfn> {
87230
87230
<li><p>If <var>result</var> is null, asynchronously complete this algorithm with null and abort
87231
87231
these steps.</p></li>
87232
87232
87233
+ <li><p>If <var>result</var>'s <span data-x="concept-module-script-state">state</span> is "<code
87234
+ data-x="">instantiated</code>" or "<code data-x="">errored</code>", asynchronously complete this
87235
+ algorithm with <var>result</var>, and abort these steps.</p></li>
87236
+
87237
+ <li><p>Assert: <var>result</var>'s <span data-x="concept-module-script-state">state</span> is
87238
+ "<code data-x="">uninstantiated</code>".</p></li>
87239
+
87233
87240
<li>
87234
- <p>Otherwise, <var>result</var> is a <span>module script</span>. <span data-x="fetch the
87235
- descendants of a module script">Fetch the descendants</span> of <var>result</var> given
87236
- <var>destination</var> and an ancestor list obtained by appending <var>url</var> to <var>ancestor
87237
- list</var>. Wait for <span data-x="fetch the descendants of a module script">fetching the
87238
- descendants of a module script</span> to asynchronously complete with <var>descendants
87239
- result</var> before proceeding to the next step.</p>
87241
+ <p><span data-x="fetch the descendants of a module script">Fetch the
87242
+ descendants</span> of <var>result</var> given <var>destination</var> and an ancestor list
87243
+ obtained by appending <var>url</var> to <var>ancestor list</var>. Wait for <span data-x="fetch
87244
+ the descendants of a module script">fetching the descendants of a module script</span> to
87245
+ asynchronously complete with <var>descendants result</var> before proceeding to the next step.</p>
87240
87246
87241
87247
<p class="note">If the asynchronous completion result is null, meaning that fetching one of the
87242
87248
descendants failed, we still proceed through the next set of steps. A failure will shortly occur
87243
87249
during instantiation, which we then react to appropriately. The error signal is eventually
87244
87250
propagated to the caller of this algorithm in the last step.</p>
87245
87251
</li>
87246
87252
87247
- <li><p>Let <var>instantiationStatus</var> be null.</p></li>
87248
-
87249
- <li><p>If <var>result</var>'s <span data-x="concept-module-script-instantiation-state">instantiation
87250
- state</span> is "<code data-x="">errored</code>", then set <var>instantiationStatus</var> to
87251
- Completion { [[Type]]: throw, [[Value]]: <var>result</var>'s <span
87252
- data-x="concept-module-script-instantiation-error">instantiation error</span>, [[Target]]:
87253
- empty }.</p></li>
87253
+ <li><p>Let <var>record</var> be <var>result</var>'s <span
87254
+ data-x="concept-module-script-module-record">module record</span>.</p></li>
87254
87255
87255
87256
<li>
87256
- <p>Otherwise:</p>
87257
-
87258
- <ol>
87259
- <li><p>Let <var>record</var> be <var>result</var>'s <span
87260
- data-x="concept-module-script-module-record">module record</span>.</p></li>
87261
-
87262
- <li>
87263
- <p>Set <var>instantiationStatus</var> to <var>record</var>.<span
87264
- data-x="js-ModuleDeclarationInstantiation">ModuleDeclarationInstantiation</span>().</p>
87257
+ <p>Let <var>instantiationStatus</var> be <var>record</var>.<span
87258
+ data-x="js-ModuleDeclarationInstantiation">ModuleDeclarationInstantiation</span>().</p>
87265
87259
87266
- <p class="note">This step will recursively call <span
87267
- data-x="js-ModuleDeclarationInstantiation">ModuleDeclarationInstantiation</span> all of the
87268
- module's uninstantiated dependencies.</p>
87269
- </li>
87270
- </ol>
87260
+ <p class="note">This step will recursively call <span
87261
+ data-x="js-ModuleDeclarationInstantiation">ModuleDeclarationInstantiation</span> all of the
87262
+ module's uninstantiated dependencies.</p>
87271
87263
</li>
87272
87264
87273
87265
<li>
87274
- <p>For each <var>script</var> in <var>result</var>'s <span>uninstantiated inclusive descendant module
87275
- scripts</span>, perform the following steps:</p>
87266
+ <p>For each <var>script</var> in <var>result</var>'s <span>uninstantiated inclusive descendant
87267
+ module scripts</span>, perform the following steps:</p>
87276
87268
87277
87269
<ol>
87278
87270
<li>
@@ -87285,18 +87277,16 @@ interface <dfn>NavigatorOnLine</dfn> {
87285
87277
<li><p>Set <var>script</var>'s <span data-x="concept-module-script-module-record">module
87286
87278
record</span> to null.</p></li>
87287
87279
87288
- <li><p>Set <var>script</var>'s <span
87289
- data-x="concept-module-script-instantiation-state">instantiation state</span> to "<code
87290
- data-x="">errored</code>".</p></li>
87280
+ <li><p>Set <var>script</var>'s <span data-x="concept-module-script-state">state</span> to
87281
+ "<code data-x="">errored</code>".</p></li>
87291
87282
87292
- <li><p>Set <var>script</var>'s <span
87293
- data-x="concept-module-script-instantiation-error">instantiation error</span> to
87283
+ <li><p>Set <var>script</var>'s <span data-x="concept-module-script-error">error</span> to
87294
87284
<var>instantiationStatus</var>.[[Value]].</p></li>
87295
87285
</ol>
87296
87286
</li>
87297
87287
87298
87288
<li><p>Otherwise, set <var>script</var>'s <span
87299
- data-x="concept-module-script-instantiation- state">instantiation state</span> to "<code
87289
+ data-x="concept-module-script-state">state</span> to "<code
87300
87290
data-x="">instantiated</code>".</p></li>
87301
87291
</ol>
87302
87292
</li>
@@ -87314,6 +87304,9 @@ interface <dfn>NavigatorOnLine</dfn> {
87314
87304
data-x="module script">module scripts</span> determined as follows:</p>
87315
87305
87316
87306
<ol>
87307
+ <li><p>If <var>script</var>'s <span data-x="concept-module-script-module-record">module
87308
+ record</span> is null, return the empty set.</p></li>
87309
+
87317
87310
<li><p>Let <var>moduleMap</var> be <var>script</var>'s <span>settings object</span>'s
87318
87311
<span data-x="concept-settings-object-module-map">module map</span>.</p></li>
87319
87312
@@ -87372,7 +87365,7 @@ interface <dfn>NavigatorOnLine</dfn> {
87372
87365
</li>
87373
87366
87374
87367
<li><p>Return a <span>set</span> containing all items of <var>inclusive descendants</var> whose
87375
- <span data-x="concept-module-script-instantiation- state">instantiation state</span> is "<code
87368
+ <span data-x="concept-module-script-state">state</span> is "<code
87376
87369
data-x="">uninstantiated</code>".</p></li>
87377
87370
</ol>
87378
87371
@@ -87505,10 +87498,14 @@ interface <dfn>NavigatorOnLine</dfn> {
87505
87498
<ol>
87506
87499
<li><p>Let <var>error</var> be a new <code>TypeError</code> exception.</p></li>
87507
87500
87508
- <li><p><span>Report the exception</span> <var>error</var> for <var>module
87509
- script</var>.</p></li>
87501
+ <li><p>Set <var>module script</var>'s <span data-x="concept-module-script-state">state</span>
87502
+ to "<code data-x="">errored</code>".</p></li>
87503
+
87504
+ <li><p>Set <var>module script</var>'s <span data-x="concept-module-script-error">error</span>
87505
+ to <var>error</var>.</p></li>
87510
87506
87511
- <li><p>Abort this algorithm, and asynchronously complete it with null.</p></li>
87507
+ <li><p>Abort this algorithm, and asynchronously complete it with <var>module
87508
+ script</var>.</p></li>
87512
87509
</ol>
87513
87510
</li>
87514
87511
@@ -87531,10 +87528,25 @@ interface <dfn>NavigatorOnLine</dfn> {
87531
87528
<span data-x="fetching-scripts-perform-fetch">perform the fetch</span> steps, pass those along
87532
87529
while performing the <span>internal module script graph fetching procedure</span>.</p>
87533
87530
87534
- <p>Wait for all of the <span>internal module script graph fetching procedure</span> invocations
87535
- to asynchronously complete. If any of them asynchronously complete with null, then
87536
- asynchronously complete this algorithm with null. Otherwise, asynchronously complete this
87537
- algorithm with <var>module script</var>.</p>
87531
+ <p>These invocations of the <span>internal module script graph fetching procedure</span> should
87532
+ be performed in parallel to each other.</p>
87533
+
87534
+ <p>If any invocation of the <span>internal module script graph fetching procedure</span>
87535
+ asynchronously completes with null, optionally abort all other invocations, and then
87536
+ asynchronously complete this algorithm with null.</p>
87537
+
87538
+ <p>If any invocation of the <span>internal module script graph fetching procedure</span>
87539
+ asynchronously completes with a <span>module script</span> whose <span
87540
+ data-x="concept-module-script-state">state</span> is "<code data-x="">errored</code>",
87541
+ optionally abort all other invocations, and then asynchronously complete this algorithm with
87542
+ <var>module script</var>. (The errored descendant will cause errors later in the module-fetching
87543
+ process, but for now we treat it as a premature "success".)</p>
87544
+
87545
+ <p>Otherwise, wait for all of the <span>internal module script graph fetching procedure</span>
87546
+ invocations to asynchronously complete, with <span data-x="module script">module scripts</span>
87547
+ whose <span data-x="concept-module-script-state">states</span> are not "<code
87548
+ data-x="">errored</code>". Then, asynchronously complete this algorithm with <var>module
87549
+ script</var>.</p>
87538
87550
</li>
87539
87551
</ol>
87540
87552
@@ -87595,9 +87607,22 @@ interface <dfn>NavigatorOnLine</dfn> {
87595
87607
<var>result</var>.[[HostDefined]] will be <var>script</var>.</p>
87596
87608
</li>
87597
87609
87598
- <li><p>If <var>result</var> is a <span>List</span> of errors, <span>report the exception</span>
87599
- given by the first element of <var>result</var> for <var>script</var>, return null, and abort
87600
- these steps.</p></li>
87610
+ <li>
87611
+ <p>If <var>result</var> is a <span>List</span> of errors, then:</p>
87612
+
87613
+ <ol>
87614
+ <li><p>Set <var>script</var>'s <span data-x="concept-module-script-state">state</span> to
87615
+ "<code data-x="">errored</code>".</p></li>
87616
+
87617
+ <li><p>Set <var>script</var>'s <span data-x="concept-module-script-error">error</span> to
87618
+ <var>errors</var>[0].</p></li>
87619
+
87620
+ <li><p>Return <var>script</var>.</p></li>
87621
+ </ol>
87622
+ </li>
87623
+
87624
+ <li><p>Set <var>script</var>'s <span data-x="concept-module-script-state">state</span> to "<code
87625
+ data-x="">uninstantiated</code>".</p></li>
87601
87626
87602
87627
<li><p>Set <var>script</var>'s <span data-x="concept-module-script-module-record">module
87603
87628
record</span> to <var>result</var>.</p></li>
@@ -87695,14 +87720,12 @@ interface <dfn>NavigatorOnLine</dfn> {
87695
87720
<li><p><span>Check if we can run script</span> with <var>settings</var>. If this returns "do
87696
87721
not run" then abort these steps.</p></li>
87697
87722
87698
- <li><p>If <var>s</var>'s <span data-x="concept-module-script-instantiation-state">instantiation
87699
- state</span> is "<code data-x="">errored</code>", then <span>report the
87700
- exception</span> given by <var>s</var>'s <span
87701
- data-x="concept-module-script-instantiation-error">instantiation error</span> for <var>s</var>
87702
- and abort these steps.</p></li>
87723
+ <li><p>If <var>s</var>'s <span data-x="concept-module-script-state">state</span> is "<code
87724
+ data-x="">errored</code>", then <span>report the exception</span> given by <var>s</var>'s <span
87725
+ data-x="concept-module-script-error">error</span> for <var>s</var> and abort these
87726
+ steps.</p></li>
87703
87727
87704
- <li><p>Assert: <var>s</var>'s <span
87705
- data-x="concept-module-script-instantiation-state">instantiation state</span> is "<code
87728
+ <li><p>Assert: <var>s</var>'s <span data-x="concept-module-script-state">state</span> is "<code
87706
87729
data-x="">instantiated</code>" (and thus its <span
87707
87730
data-x="concept-module-script-module-record">module record</span> is not null).</p></li>
87708
87731
@@ -88578,14 +88601,14 @@ import "https://example.com/foo/../module2.js";</pre>
88578
88601
steps.</p></li>
88579
88602
88580
88603
<li><p>If <var>resolved module script</var>'s <span
88581
- data-x="concept-module-script-instantiation- state">instantiation state</span> is "<code
88582
- data-x="">errored</code>", then throw <var>resolved module script</var>'s <span
88583
- data-x="concept-module-script-instantiation- error">instantiation error</span>.</p></li>
88604
+ data-x="concept-module-script-state">state</span> is "<code data-x="">errored</code>", then throw
88605
+ <var>resolved module script</var>'s <span
88606
+ data-x="concept-module-script-error">error</span>.</p></li>
88584
88607
88585
88608
<li><p>Assert: <var>resolved module script</var>'s <span
88586
- data-x="concept-module-script-instantiation- state">instantiation state</span> is "<code
88587
- data-x="">instantiated</code>" (and thus its <span
88588
- data-x="concept-module-script-module-record">module record</span> is not null).</p></li>
88609
+ data-x="concept-module-script-state">state</span> is "<code data-x="">instantiated</code>" (and
88610
+ thus its <span data-x="concept-module-script-module-record">module record</span> is not
88611
+ null).</p></li>
88589
88612
88590
88613
<li><p>Return <var>resolved module script</var>'s <span
88591
88614
data-x="concept-module-script-module-record">module record</span>.</p></li>
0 commit comments