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
@@ -11523,10 +11523,10 @@ <h1>Realms</h1>
11523
11523
[[LoadedModules]]
11524
11524
</td>
11525
11525
<td>
11526
-
a List of Records with fields [[Specifier]] (a String), [[Attributes]] (a List of ImportAttribute Records) and [[Module]] (a Module Record)
11526
+
a List of LoadedModuleRequest Records
11527
11527
</td>
11528
11528
<td>
11529
-
<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>
11529
+
<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>
11530
11530
<emu-note>
11531
11531
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>.
19360
19360
1. Let _value_ be ! <emu-meta suppress-effects="user-code">Get(_entry_, *"1"*)</emu-meta>.
19361
-
1. If Type(_value_) is not String, then
19361
+
1. If _value_ is not a String, then
19362
19362
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « a newly created *TypeError* object »).
19363
19363
1. Return _promiseCapability_.[[Promise]].
19364
19364
1. Append the ImportAttribute Record { [[Key]]: _key_, [[Value]]: _value_ } to _attributes_.
@@ -25699,10 +25699,10 @@ <h1>Script Records</h1>
25699
25699
[[LoadedModules]]
25700
25700
</td>
25701
25701
<td>
25702
-
a List of Records with fields [[Specifier]] (a String), [[Attributes]] (a List of ImportAttribute Records) and [[Module]] (a Module Record)
25702
+
a List of LoadedModuleRequest Records
25703
25703
</td>
25704
25704
<td>
25705
-
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]].
25705
+
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*.
25706
25706
</td>
25707
25707
</tr>
25708
25708
<tr>
@@ -25944,7 +25944,7 @@ <h1>
25944
25944
</emu-clause>
25945
25945
25946
25946
<emu-clause id="sec-modulerequest-record">
25947
-
<h1>ModuleRequest and ImportAttribute Records</h1>
25947
+
<h1>ModuleRequest Records</h1>
25948
25948
25949
25949
<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>
25950
25950
<emu-table id="table-modulerequest-fields" caption="ModuleRequest Record fields">
@@ -25985,6 +25985,34 @@ <h1>ModuleRequest and ImportAttribute Records</h1>
25985
25985
</table>
25986
25986
</emu-table>
25987
25987
25988
+
<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>
25989
+
<emu-table id="table-loadedmodulerequest-fields" caption="Additional fields of LoadedModuleRequest Records">
25990
+
<table>
25991
+
<tr>
25992
+
<th>
25993
+
Field Name
25994
+
</th>
25995
+
<th>
25996
+
Value Type
25997
+
</th>
25998
+
<th>
25999
+
Meaning
26000
+
</th>
26001
+
</tr>
26002
+
<tr>
26003
+
<td>
26004
+
[[Module]]
26005
+
</td>
26006
+
<td>
26007
+
a Module Record
26008
+
</td>
26009
+
<td>
26010
+
The loaded module corresponding to this module request
26011
+
</td>
26012
+
</tr>
26013
+
</table>
26014
+
</emu-table>
26015
+
25988
26016
<p>An <dfn id="importattribute-record" variants="ImportAttribute Records">ImportAttribute Record</dfn> consists of the following fields:</p>
25989
26017
<emu-table id="table-importattribute-fields" caption="ImportAttribute Record fields">
25990
26018
<table>
@@ -26023,6 +26051,36 @@ <h1>ModuleRequest and ImportAttribute Records</h1>
@@ -26042,7 +26100,7 @@ <h1>Static Semantics: ModuleRequests ( ): a List of ModuleRequest Records</h1>
26042
26100
1. Let _requests_ be ModuleRequests of |ModuleItemList|.
26043
26101
1. Let _additionalRequests_ be ModuleRequests of |ModuleItem|.
26044
26102
1. For each ModuleRequest Record _mr_ of _additionalRequests_, do
26045
-
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
26103
+
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)
26355
+
a List of LoadedModuleRequest Records
26298
26356
</td>
26299
26357
<td>
26300
-
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.
26358
+
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*.
26301
26359
</td>
26302
26360
</tr>
26303
26361
<tr>
@@ -26516,7 +26574,7 @@ <h1>
26516
26574
1. Let _requestedModulesCount_ be the number of elements in _module_.[[RequestedModules]].
26517
26575
1. Set _state_.[[PendingModulesCount]] to _state_.[[PendingModulesCount]] + _requestedModulesCount_.
26518
26576
1. For each ModuleRequest Record _request_ of _module_.[[RequestedModules]], do
26519
-
1. If _module_.[[LoadedModules]] contains a Record _record_ such that _record_.[[Specifier]] is _request_.[[Specifier]] and ImportAttributesEqual(_record_.[[Attributes]], _request_.[[Attributes]]) is *true*, then
26577
+
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.
28030
-
1. Let _record_ be the Record in _referrer_.[[LoadedModules]] such that _record_.[[Specifier]] is _request_.[[Specifier]] and ImportAttributesEqual(_record_.[[Attributes]], _request_.[[Attributes]]) is *true*.
28087
+
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.
28088
+
1. Let _record_ be the LoadedModuleRequest Record in _referrer_.[[LoadedModules]] such that ModuleRequestsEqual(_record_, _request_) is *true*.
28031
28089
1. Return _record_.[[Module]].
28032
28090
</emu-alg>
28033
28091
</emu-clause>
@@ -28063,8 +28121,7 @@ <h1>
28063
28121
<p>If this operation is called multiple times with two (_referrer_, _moduleRequest_) pairs such that:</p>
28064
28122
<ul>
28065
28123
<li>the first _referrer_ is the same as the second _referrer_;</li>
28066
-
<li>the first _moduleRequest_.[[Specifier]] is the same as the second _moduleRequest_.[[Specifier]];</li>
28067
-
<li>ImportAttributesEqual(the first _moduleRequest_.[[Attributes]], the second _moduleRequest_.[[Attributes]]) is *true*;</li>
28124
+
<li>ModuleRequestsEqual(the first _moduleRequest_, the second _moduleRequest_) is *true*;</li>
28068
28125
</ul>
28069
28126
<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>
28070
28127
</li>
@@ -28091,10 +28148,10 @@ <h1>
28091
28148
</dl>
28092
28149
<emu-alg>
28093
28150
1. If _result_ is a normal completion, then
28094
-
1. If _referrer_.[[LoadedModules]] contains a Record _record_ such that _record_.[[Specifier]] is _moduleRequest_.[[Specifier]] and ImportAttributesEqual(_record_.[[Attributes]], _moduleRequest_.[[Attributes]]) is *true*, then
28151
+
1. If _referrer_.[[LoadedModules]] contains a LoadedModuleRequest Record _record_ such that ModuleRequestsEqual(_record_, _moduleRequest_) is *true*, then
28095
28152
1. Assert: _record_.[[Module]] is _result_.[[Value]].
28096
28153
1. Else,
28097
-
1. Append the Record { [[Specifier]]: _moduleRequest_.[[Specifer]], [[Attributes]]: _moduleRequest_.[[Attributes]], [[Module]]: _result_.[[Value]] } to _referrer_.[[LoadedModules]].
28154
+
1. Append the LoadedModuleRequest Record { [[Specifier]]: _moduleRequest_.[[Specifer]], [[Attributes]]: _moduleRequest_.[[Attributes]], [[Module]]: _result_.[[Value]] } to _referrer_.[[LoadedModules]].
28098
28155
1. If _payload_ is a GraphLoadingState Record, then
0 commit comments