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
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*.
625
625
</td>
626
626
</tr>
627
-
<tr>
628
-
<td>
629
-
<ins>[[OptionalIndirectExportEntries]]</ins>
630
-
</td>
631
-
<td>
632
-
<ins>a List of ExportEntry Records whose [[LocalName]] is *null*.</ins>
633
-
</td>
634
-
<td>
635
-
<ins>A list of all the bindings re-exported through `export defer { ... } from "..."`. The List is in source text occurrence order.</ins>
636
-
</td>
637
-
</tr>
638
627
<tr>
639
628
<td>
640
629
[[CycleRoot]]
@@ -732,6 +721,19 @@ contributors: Nicolò Ribaudo
732
721
Evaluate the module's code within its execution context. If this module has *true* in [[HasTLA]], then a PromiseCapability Record is passed as an argument, and the method is expected to resolve or reject the given capability. In this case, the method must not throw an exception, but instead reject the PromiseCapability Record if necessary.
<p><ins>Returns a list of ModuleRequest Records describing the additional dependencies (not already listed in this module's [[RequestedModules]]) needed to be able to import _importedNames_ from this module. In case of a Source Text Module Record, these would be the dependencies specified through `export defer`. _importedNames_ is either ~all~ or a List of Strings.</ins></p>
730
+
731
+
<p><ins>This abstract method has the following default implementation:</ins></p>
732
+
<emu-alg>
733
+
1. <ins>Return a new empty List.</ins>
734
+
</emu-alg>
735
+
</td>
736
+
</tr>
735
737
</table>
736
738
</emu-table>
737
739
@@ -940,7 +942,7 @@ contributors: Nicolò Ribaudo
940
942
1. Return ? _result_.
941
943
1. Assert: _module_.[[Status]] is one of ~linked~, ~evaluating-async~, or ~evaluated~.
942
944
1. Assert: _stack_ is empty.
943
-
1. <ins>Let _indirectRequests_ be GetOptionalIndirectExportsModuleRequests(_module_, _importedNames_).</ins>
945
+
1. <ins>Let _indirectRequests_ be _module_.GetOptionalIndirectExportsModuleRequests(_importedNames_).</ins>
944
946
1. <ins>For each ModuleRequest Record _request_ of _indirectRequests_, do</ins>
945
947
1. <ins>Let _requiredModule_ be GetImportedModule(_module_, _request_).</ins>
946
948
1. <ins>Assert: _requiredModule_.[[Status]] is one of ~unlinked~, ~linked~, ~evaluating-async~, or ~evaluated~.</ins>
<p>A <dfn id="sourctextmodule-record" variants="Source Text Module Records">Source Text Module Record</dfn> is used to represent information about a module that was defined from ECMAScript source text (<emu-xref href="#sec-ecmascript-language-source-code"></emu-xref>) that was parsed using the goal symbol |Module|. Its fields contain digested information about the names that are imported and exported by the module, and its concrete methods use these digests to link and evaluate the module.</p>
1296
+
1297
+
<p>A Source Text Module Record can exist in a module graph with other subclasses of the abstract Module Record type, and can participate in cycles with other subclasses of the Cyclic Module Record type.</p>
1298
+
1299
+
<p>In addition to the fields defined in <emu-xref href="#table-cyclic-module-fields"></emu-xref>, Source Text Module Records have the additional fields listed in <emu-xref href="#table-additional-fields-of-source-text-module-records"></emu-xref>. Each of these fields is initially set in ParseModule.</p>
1300
+
<emu-table id="table-additional-fields-of-source-text-module-records" caption="Additional Fields of Source Text Module Records" oldids="table-38">
1301
+
<table>
1302
+
<thead>
1303
+
<tr>
1304
+
<th>
1305
+
Field Name
1306
+
</th>
1307
+
<th>
1308
+
Value Type
1309
+
</th>
1310
+
<th>
1311
+
Meaning
1312
+
</th>
1313
+
</tr>
1314
+
</thead>
1315
+
<tr>
1316
+
<td>
1317
+
[[ECMAScriptCode]]
1318
+
</td>
1319
+
<td>
1320
+
a Parse Node
1321
+
</td>
1322
+
<td>
1323
+
The result of parsing the source text of this module using |Module| as the goal symbol.
1324
+
</td>
1325
+
</tr>
1326
+
<tr>
1327
+
<td>
1328
+
[[Context]]
1329
+
</td>
1330
+
<td>
1331
+
an ECMAScript code execution context or ~empty~
1332
+
</td>
1333
+
<td>
1334
+
The execution context associated with this module. It is ~empty~ until the module's environment has been initialized.
1335
+
</td>
1336
+
</tr>
1337
+
<tr>
1338
+
<td>
1339
+
[[ImportMeta]]
1340
+
</td>
1341
+
<td>
1342
+
an Object or ~empty~
1343
+
</td>
1344
+
<td>
1345
+
An object exposed through the `import.meta` meta property. It is ~empty~ until it is accessed by ECMAScript code.
1346
+
</td>
1347
+
</tr>
1348
+
<tr>
1349
+
<td>
1350
+
[[ImportEntries]]
1351
+
</td>
1352
+
<td>
1353
+
a List of ImportEntry Records
1354
+
</td>
1355
+
<td>
1356
+
A List of ImportEntry records derived from the code of this module.
1357
+
</td>
1358
+
</tr>
1359
+
<tr>
1360
+
<td>
1361
+
[[LocalExportEntries]]
1362
+
</td>
1363
+
<td>
1364
+
a List of ExportEntry Records
1365
+
</td>
1366
+
<td>
1367
+
A List of ExportEntry records derived from the code of this module that correspond to declarations that occur within the module.
1368
+
</td>
1369
+
</tr>
1370
+
<tr>
1371
+
<td>
1372
+
[[IndirectExportEntries]]
1373
+
</td>
1374
+
<td>
1375
+
a List of ExportEntry Records
1376
+
</td>
1377
+
<td>
1378
+
A List of ExportEntry records derived from the code of this module that correspond to reexported imports that occur within the module or exports from `export * as namespace` declarations.
1379
+
</td>
1380
+
</tr>
1381
+
<tr>
1382
+
<td>
1383
+
[[StarExportEntries]]
1384
+
</td>
1385
+
<td>
1386
+
a List of ExportEntry Records
1387
+
</td>
1388
+
<td>
1389
+
A List of ExportEntry records derived from the code of this module that correspond to `export *` declarations that occur within the module, not including `export * as namespace` declarations.
1390
+
</td>
1391
+
</tr>
1392
+
<tr>
1393
+
<td>
1394
+
<ins>[[OptionalIndirectExportEntries]]</ins>
1395
+
</td>
1396
+
<td>
1397
+
<ins>a List of ExportEntry Records whose [[LocalName]] is *null*.</ins>
1398
+
</td>
1399
+
<td>
1400
+
<ins>A list of all the bindings re-exported through `export defer { ... } from "..."`. The List is in source text occurrence order.</ins>
<h1>Implementation of Cyclic Module Record Abstract Methods</h1>
1573
+
1574
+
<p>The following are the concrete methods for Source Text Module Record that implement the corresponding Cyclic Module Record abstract methods defined in <emu-xref href="#table-cyclic-module-methods"></emu-xref>.</p>
1. For each ExportEntry Record _oie_ of _module_.[[OptionalIndirectExportEntries]], do
1592
+
1. If _importedNames_ is ~all~ or _importedNames_ contains _oie_.[[ExportName]], then
1593
+
1. Let _nextRequest_ be _oie_.[[ModuleRequest]].
1594
+
1. Let _existingRequest_ be ~empty~.
1595
+
1. For each ModuleRequest Record _r_ in _requests_, do
1596
+
1. If _existingRequest_ is ~empty~ and ModuleRequestsEqual(_r_, _nextRequest_) is *true* and _r_.[[Phase]] is _nextRequest_.[[Phase]], then
1597
+
1. Set _existingRequest_ to _r_.
1598
+
1. Let _newImportedNames_ be ~all~.
1599
+
1. Assert: _oie_.[[ImportName]] is a String or ~all~.
1600
+
1. If _oie_.[[ImportName]] is a String, set _newImportedNames_ to « _oie_.[[ImportName]] ».
1601
+
1. If _existingRequest_ is ~empty~, then
1602
+
1. Let _request_ be the ModuleRequest Record { [[Specifier]]: _nextRequest_.[[Specifier]], [[Attributes]]: _nextRequest_.[[Attributes]], [[Phase]]: _nextRequest_.[[Phase]], [[ImportedNames]]: _newImportedNames_ }.
1603
+
1. Append _request_ to _requests_.
1604
+
1. Else,
1605
+
1. Set _existingRequest_.[[ImportedNames]] to MergeImportedNames(_existingRequest_.[[ImportedNames]], _newImportedNames_).
1. For each ExportEntry Record _oie_ of _module_.[[OptionalIndirectExportEntries]], do
1479
-
1. If _importedNames_ is ~all~ or _importedNames_ contains _oie_.[[ExportName]], then
1480
-
1. Let _nextRequest_ be _oie_.[[ModuleRequest]].
1481
-
1. Let _existingRequest_ be ~empty~.
1482
-
1. For each ModuleRequest Record _r_ in _requests_, do
1483
-
1. If _existingRequest_ is ~empty~ and ModuleRequestsEqual(_r_, _nextRequest_) is *true* and _r_.[[Phase]] is _nextRequest_.[[Phase]], then
1484
-
1. Set _existingRequest_ to _r_.
1485
-
1. Let _newImportedNames_ be ~all~.
1486
-
1. Assert: _oie_.[[ImportName]] is a String or ~all~.
1487
-
1. If _oie_.[[ImportName]] is a String, set _newImportedNames_ to « _oie_.[[ImportName]] ».
1488
-
1. If _existingRequest_ is ~empty~, then
1489
-
1. Let _request_ be the ModuleRequest Record { [[Specifier]]: _nextRequest_.[[Specifier]], [[Attributes]]: _nextRequest_.[[Attributes]], [[Phase]]: _nextRequest_.[[Phase]], [[ImportedNames]]: _newImportedNames_ }.
1490
-
1. Append _request_ to _requests_.
1491
-
1. Else,
1492
-
1. Set _existingRequest_.[[ImportedNames]] to MergeImportedNames(_existingRequest_.[[ImportedNames]], _newImportedNames_).
0 commit comments