You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: spec.html
+79-49
Original file line number
Diff line number
Diff line change
@@ -11535,10 +11535,10 @@ <h1>Realms</h1>
11535
11535
[[LoadedModules]]
11536
11536
</td>
11537
11537
<td>
11538
-
a List of Records with fields [[Specifier]] (a String), [[Attributes]] (a List of ImportAttribute Records) and [[Module]] (a Module Record)
11538
+
a List of LoadedModuleRequest Records
11539
11539
</td>
11540
11540
<td>
11541
-
<p>A map from the specifier strings imported by this realm to the resolved Module Record. The list does not contain two different Records with the same [[Specifier]].</p>
11541
+
<p>A map from the specifier strings imported by this realm to the resolved Module Record. The list does not contain two different Records _r1_ and _r2_ such that ModuleRequestsEqual(_r1_, _r2_) is *true*.</p>
11542
11542
<emu-note>
11543
11543
As mentioned in HostLoadImportedModule (<emu-xref href="#note-HostLoadImportedModule-referrer-Realm-Record"></emu-xref>), [[LoadedModules]] in Realm Records is only used when running an `import()` expression in a context where there is no active script or module.
1. Let _key_ be ! <emu-meta suppress-effects="user-code">Get(_entry_, *"0"*)</emu-meta>.
19373
19373
1. Let _value_ be ! <emu-meta suppress-effects="user-code">Get(_entry_, *"1"*)</emu-meta>.
19374
-
1. If Type(_value_) is not String, then
19374
+
1. If _value_ is not a String, then
19375
19375
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « a newly created *TypeError* object »).
19376
19376
1. Return _promiseCapability_.[[Promise]].
19377
19377
1. Append the ImportAttribute Record { [[Key]]: _key_, [[Value]]: _value_ } to _attributes_.
@@ -25712,10 +25712,10 @@ <h1>Script Records</h1>
25712
25712
[[LoadedModules]]
25713
25713
</td>
25714
25714
<td>
25715
-
a List of Records with fields [[Specifier]] (a String), [[Attributes]] (a List of ImportAttribute Records) and [[Module]] (a Module Record)
25715
+
a List of LoadedModuleRequest Records
25716
25716
</td>
25717
25717
<td>
25718
-
A map from the specifier strings imported by this script to the resolved Module Record. The list does not contain two different Records with the same [[Specifier]].
25718
+
A map from the specifier strings imported by this script to the resolved Module Record. The list does not contain two different Records _r1_ and _r2_ such that ModuleRequestsEqual(_r1_, _r2_) is *true*.
25719
25719
</td>
25720
25720
</tr>
25721
25721
<tr>
@@ -25957,7 +25957,7 @@ <h1>
25957
25957
</emu-clause>
25958
25958
25959
25959
<emu-clause id="sec-modulerequest-record">
25960
-
<h1>ModuleRequest and ImportAttribute Records</h1>
25960
+
<h1>ModuleRequest Records</h1>
25961
25961
25962
25962
<p>A <dfn id="modulerequest-record" variants="ModuleRequest Records">ModuleRequest Record</dfn> represents the request to import a module with given import attributes. It consists of the following fields:</p>
25963
25963
<emu-table id="table-modulerequest-fields" caption="ModuleRequest Record fields">
@@ -25998,6 +25998,34 @@ <h1>ModuleRequest and ImportAttribute Records</h1>
25998
25998
</table>
25999
25999
</emu-table>
26000
26000
26001
+
<p>A <dfn id="loadedmodulerequest-record" variants="LoadedModuleRequest Records">LoadedModuleRequest Record</dfn> represents the request to import a module together with the resulting Module Record. It consists of the fields defined in table <emu-xref href="#table-modulerequest-fields"></emu-xref>, alongside with the following additions:</p>
26002
+
<emu-table id="table-loadedmodulerequest-fields" caption="Additional fields of LoadedModuleRequest Records">
26003
+
<table>
26004
+
<tr>
26005
+
<th>
26006
+
Field Name
26007
+
</th>
26008
+
<th>
26009
+
Value Type
26010
+
</th>
26011
+
<th>
26012
+
Meaning
26013
+
</th>
26014
+
</tr>
26015
+
<tr>
26016
+
<td>
26017
+
[[Module]]
26018
+
</td>
26019
+
<td>
26020
+
a Module Record
26021
+
</td>
26022
+
<td>
26023
+
The loaded module corresponding to this module request
26024
+
</td>
26025
+
</tr>
26026
+
</table>
26027
+
</emu-table>
26028
+
26001
26029
<p>An <dfn id="importattribute-record" variants="ImportAttribute Records">ImportAttribute Record</dfn> consists of the following fields:</p>
26002
26030
<emu-table id="table-importattribute-fields" caption="ImportAttribute Record fields">
26003
26031
<table>
@@ -26036,6 +26064,36 @@ <h1>ModuleRequest and ImportAttribute Records</h1>
@@ -26055,7 +26113,7 @@ <h1>Static Semantics: ModuleRequests ( ): a List of ModuleRequest Records</h1>
26055
26113
1. Let _requests_ be ModuleRequests of |ModuleItemList|.
26056
26114
1. Let _additionalRequests_ be ModuleRequests of |ModuleItem|.
26057
26115
1. For each ModuleRequest Record _mr_ of _additionalRequests_, do
26058
-
1. If _requests_ does not contain a ModuleRequest Record _mr2_ such that _mr_.[[Specifier]] is _mr2_.[[Specifier]] and ImportAttributesEqual(_mr_.[[Attributes]], _mr2_.[[Attributes]]) is *true*, then
26116
+
1. If _requests_ does not contain a ModuleRequest Record _mr2_ such that ModuleRequestsEqual(_mr_, _mr2_) is *true*, then
a List of Records with fields [[Specifier]] (a String), [[Attributes]] (a List of ImportAttribute Records) and [[Module]] (a Module Record)
26368
+
a List of LoadedModuleRequest Records
26311
26369
</td>
26312
26370
<td>
26313
-
A map from the specifier strings used by the module represented by this record to request the importation of a module with the relative import attributes to the resolved Module Record. The list does not contain two different Records with the same ([[Specifier]], [[Attributes]]) pair.
26371
+
A map from the specifier strings used by the module represented by this record to request the importation of a module with the relative import attributes to the resolved Module Record. The list does not contain two different Records _r1_ and _r2_ such that ModuleRequestsEqual(_r1_, _r2_) is *true*.
26314
26372
</td>
26315
26373
</tr>
26316
26374
<tr>
@@ -26529,7 +26587,7 @@ <h1>
26529
26587
1. Let _requestedModulesCount_ be the number of elements in _module_.[[RequestedModules]].
26530
26588
1. Set _state_.[[PendingModulesCount]] to _state_.[[PendingModulesCount]] + _requestedModulesCount_.
26531
26589
1. For each ModuleRequest Record _request_ of _module_.[[RequestedModules]], do
26532
-
1. If _module_.[[LoadedModules]] contains a Record _record_ such that _record_.[[Specifier]] is _request_.[[Specifier]] and ImportAttributesEqual(_record_.[[Attributes]], _request_.[[Attributes]]) is *true*, then
26590
+
1. If _module_.[[LoadedModules]] contains a LoadedModuleRequest Record _record_ such that ModuleRequestsEqual(_record_, _request_) is *true*, then
1. Assert: Exactly one element of _referrer_.[[LoadedModules]] is a Record _record_ such that _record_.[[Specifier]] is _request_.[[Specifier]] and ImportAttributesEqual(_record_.[[Attributes]], _request_.[[Attributes]]) is *true*, since LoadRequestedModules has completed successfully on _referrer_ prior to invoking this abstract operation.
28043
-
1. Let _record_ be the Record in _referrer_.[[LoadedModules]] such that _record_.[[Specifier]] is _request_.[[Specifier]] and ImportAttributesEqual(_record_.[[Attributes]], _request_.[[Attributes]]) is *true*.
28100
+
1. Assert: Exactly one element of _referrer_.[[LoadedModules]] is a LoadedModuleRequest Record _record_ such that ModuleRequestsEqual(_record_, _request_) is *true*, since LoadRequestedModules has completed successfully on _referrer_ prior to invoking this abstract operation.
28101
+
1. Let _record_ be the LoadedModuleRequest Record in _referrer_.[[LoadedModules]] such that ModuleRequestsEqual(_record_, _request_) is *true*.
28044
28102
1. Return _record_.[[Module]].
28045
28103
</emu-alg>
28046
28104
</emu-clause>
@@ -28076,8 +28134,7 @@ <h1>
28076
28134
<p>If this operation is called multiple times with two (_referrer_, _moduleRequest_) pairs such that:</p>
28077
28135
<ul>
28078
28136
<li>the first _referrer_ is the same as the second _referrer_;</li>
28079
-
<li>the first _moduleRequest_.[[Specifier]] is the same as the second _moduleRequest_.[[Specifier]];</li>
28080
-
<li>ImportAttributesEqual(the first _moduleRequest_.[[Attributes]], the second _moduleRequest_.[[Attributes]]) is *true*;</li>
28137
+
<li>ModuleRequestsEqual(the first _moduleRequest_, the second _moduleRequest_) is *true*;</li>
28081
28138
</ul>
28082
28139
<p>and it performs FinishLoadingImportedModule(_referrer_, _moduleRequest_, _payload_, _result_) where _result_ is a normal completion, then it must perform FinishLoadingImportedModule(_referrer_, _moduleRequest_, _payload_, _result_) with the same _result_ each time.</p>
28083
28140
</li>
@@ -28104,10 +28161,10 @@ <h1>
28104
28161
</dl>
28105
28162
<emu-alg>
28106
28163
1. If _result_ is a normal completion, then
28107
-
1. If _referrer_.[[LoadedModules]] contains a Record _record_ such that _record_.[[Specifier]] is _moduleRequest_.[[Specifier]] and ImportAttributesEqual(_record_.[[Attributes]], _moduleRequest_.[[Attributes]]) is *true*, then
28164
+
1. If _referrer_.[[LoadedModules]] contains a LoadedModuleRequest Record _record_ such that ModuleRequestsEqual(_record_, _moduleRequest_) is *true*, then
28108
28165
1. Assert: _record_.[[Module]] is _result_.[[Value]].
28109
28166
1. Else,
28110
-
1. Append the Record { [[Specifier]]: _moduleRequest_.[[Specifer]], [[Attributes]]: _moduleRequest_.[[Attributes]], [[Module]]: _result_.[[Value]] } to _referrer_.[[LoadedModules]].
28167
+
1. Append the LoadedModuleRequest Record { [[Specifier]]: _moduleRequest_.[[Specifer]], [[Attributes]]: _moduleRequest_.[[Attributes]], [[Module]]: _result_.[[Value]] } to _referrer_.[[LoadedModules]].
28111
28168
1. If _payload_ is a GraphLoadingState Record, then
0 commit comments