Skip to content

Commit 294a3b9

Browse files
Update abstract methods tables
1 parent 4be74ff commit 294a3b9

1 file changed

Lines changed: 86 additions & 32 deletions

File tree

spec.emu

Lines changed: 86 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ contributors: Nicolò Ribaudo
465465
</tr>
466466
</table>
467467
</emu-table>
468-
<emu-table id="table-abstract-methods-of-module-records" caption="Abstract Methods of Module Records" oldids="table-37">
468+
<emu-table id="table-abstract-methods-of-module-records" type="abstract methods" of="Module Records" oldids="table-37">
469469
<table>
470470
<thead>
471471
<tr>
@@ -475,55 +475,90 @@ contributors: Nicolò Ribaudo
475475
<th>
476476
Purpose
477477
</th>
478+
<th>
479+
Definitions
480+
</th>
478481
</tr>
479482
</thead>
480-
<tr>
483+
<tr id="abstract-loadrequestedmodules">
484+
<td>
485+
LoadRequestedModules (
486+
<ins>optional _importedNames_: ~all~ or a List of Strings,</ins>
487+
optional _hostDefined_: anything,
488+
): a Promise
489+
</td>
481490
<td>
482-
LoadRequestedModules([<ins>_importedNames_ [, </ins>_hostDefined_<ins>]</ins>])
491+
<p>It prepares the module for linking by recursively loading all its dependencies.</p>
492+
<p><ins>When this module is a Cyclic Module Record, _importedNames_ is the list of binding names whose additional modules need to be loaded, for usage with GetOptionalIndirectExportsModuleRequests(). By default, all modules re-exported by this module through GetOptionalIndirectExportsModuleRequests() are loaded.</ins></p>
483493
</td>
484494
<td>
485-
<p>Prepares the module for linking by recursively loading all its dependencies, and returns a promise.</p>
486-
<p><ins>When this module is a Cyclic Module Record, _importedNames_ is the list of binding names (or ~all~) whose additional modules need to be loaded, for usage with GetOptionalIndirectExportsModuleRequests(). By default, all modules re-exported by this module through GetOptionalIndirectExportsModuleRequests() are loaded.</ins></p>
495+
Within this specification it has definitions in the following types; hosts may provide additional types with their own definitions:
496+
<emu-concrete-method-dfns for="LoadRequestedModules"></emu-concrete-method-dfns>
487497
</td>
488498
</tr>
489-
<tr>
499+
<tr id="abstract-getexportednames">
490500
<td>
491-
GetExportedNames([_exportStarSet_])
501+
GetExportedNames (
502+
optional _exportStarSet_: a List of Source Text Module Records,
503+
): a List of Strings
492504
</td>
493505
<td>
494-
<p>Return a list of all names that are either directly or indirectly exported from this module.</p>
506+
<p>It returns a list of all names that are either directly or indirectly exported from this module.</p>
495507
<p>LoadRequestedModules must have completed successfully prior to invoking this method.</p>
496508
</td>
509+
<td>
510+
Within this specification it has definitions in the following types; hosts may provide additional types with their own definitions:
511+
<emu-concrete-method-dfns for="GetExportedNames"></emu-concrete-method-dfns>
512+
</td>
497513
</tr>
498-
<tr>
514+
<tr id="abstract-resolveexport">
499515
<td>
500-
ResolveExport(_exportName_ [, _resolveSet_])
516+
ResolveExport (
517+
_exportName_: a String,
518+
optional _resolveSet_: a List of Records with fields [[Module]] (a Module Record) and [[ExportName]] (a String),
519+
): a ResolvedBinding Record, *null*, or ~ambiguous~
501520
</td>
502521
<td>
503-
<p>Return the binding of a name exported by this module. Bindings are represented by a <dfn id="resolvedbinding-record" variants="ResolvedBinding Records">ResolvedBinding Record</dfn>, of the form { [[Module]]: Module Record, [[BindingName]]: String | ~namespace~ }. If the export is a Module Namespace Object without a direct binding in any module, [[BindingName]] will be set to ~namespace~. Return *null* if the name cannot be resolved, or ~ambiguous~ if multiple bindings were found.</p>
522+
<p>It returns the binding of a name exported by this module. Bindings are represented by a <dfn id="resolvedbinding-record" variants="ResolvedBinding Records">ResolvedBinding Record</dfn>, of the form { [[Module]]: Module Record, [[BindingName]]: String | ~namespace~ }. If the export is a Module Namespace Object without a direct binding in any module, [[BindingName]] will be set to ~namespace~. It returns *null* if the name cannot be resolved, or ~ambiguous~ if multiple bindings were found.</p>
504523
<p>Each time this operation is called with a specific _exportName_, _resolveSet_ pair as arguments it must return the same result.</p>
505524
<p>LoadRequestedModules must have completed successfully prior to invoking this method.</p>
506525
</td>
526+
<td>
527+
Within this specification it has definitions in the following types; hosts may provide additional types with their own definitions:
528+
<emu-concrete-method-dfns for="ResolveExport"></emu-concrete-method-dfns>
529+
</td>
507530
</tr>
508-
<tr>
531+
<tr id="abstract-link">
509532
<td>
510-
Link(<ins>[_importedNames_]</ins>)
533+
Link (
534+
<ins>optional _importedNames_: ~all~ or a List of Strings,</ins>
535+
): either a normal completion containing ~unused~ or a throw completion
511536
</td>
512537
<td>
513-
<p>Prepare the module for evaluation by transitively resolving all module dependencies and creating a Module Environment Record.</p>
514-
<p><ins>When this module is a Cyclic Module Record, _importedNames_ is the list of binding names (or ~all~) whose additional modules need to be linked, for usage with GetOptionalIndirectExportsModuleRequests(). By default, all modules re-exported by this module through GetOptionalIndirectExportsModuleRequests() are linked.</ins></p>
538+
<p>It prepares the module for evaluation by transitively resolving all module dependencies and creating a Module Environment Record.</p>
539+
<p><ins>When this module is a Cyclic Module Record, _importedNames_ is the list of binding names whose additional modules need to be linked, for usage with GetOptionalIndirectExportsModuleRequests(). By default, all modules re-exported by this module through GetOptionalIndirectExportsModuleRequests() are linked.</ins></p>
515540
<p>LoadRequestedModules must have completed successfully prior to invoking this method<ins>, with an _importNames_ list that includes at least the _importedNames_ passed to Link</ins>.</p>
516541
</td>
542+
<td>
543+
Within this specification it has definitions in the following types; hosts may provide additional types with their own definitions:
544+
<emu-concrete-method-dfns for="Link"></emu-concrete-method-dfns>
545+
</td>
517546
</tr>
518-
<tr>
547+
<tr id="abstract-evaluate">
519548
<td>
520-
Evaluate(<ins>[_importedNames_]</ins>)
549+
Evaluate (
550+
<ins>optional _importedNames_: ~all~ or a List of Strings,</ins>
551+
): a Promise
521552
</td>
522553
<td>
523-
<p>Returns a promise for the evaluation of this module and its dependencies, resolving on successful evaluation or if it has already been evaluated successfully, and rejecting for an evaluation error or if it has already been evaluated unsuccessfully. If the promise is rejected, hosts are expected to handle the promise rejection and rethrow the evaluation error.</p>
524-
<p><ins>When this module is a Cyclic Module Record, _importedNames_ is the list of binding names (or ~all~) whose additional modules need to be evaluated, for usage with GetOptionalIndirectExportsModuleRequests(). By default, modules re-exported by this module through GetOptionalIndirectExportsModuleRequests() are not evaluated.</ins></p>
554+
<p>It returns a promise for the evaluation of this module and its dependencies, resolving on successful evaluation or if it has already been evaluated successfully, and rejecting for an evaluation error or if it has already been evaluated unsuccessfully. If the promise is rejected, hosts are expected to handle the promise rejection and rethrow the evaluation error. Unless this module is a Cyclic Module Record, the returned promise must be already settled.</p>
555+
<p><ins>When this module is a Cyclic Module Record, _importedNames_ is the list of binding names whose additional modules need to be evaluated, for usage with GetOptionalIndirectExportsModuleRequests(). By default, modules re-exported by this module through GetOptionalIndirectExportsModuleRequests() are not evaluated.</ins></p>
525556
<p>Link must have completed successfully prior to invoking this method<ins>, with an _importNames_ list that includes at least the _importedNames_ passed to Evaluate</ins>.</p>
526557
</td>
558+
<td>
559+
Within this specification it has definitions in the following types; hosts may provide additional types with their own definitions:
560+
<emu-concrete-method-dfns for="Evaluate"></emu-concrete-method-dfns>
561+
</td>
527562
</tr>
528563
</table>
529564
</emu-table>
@@ -728,7 +763,7 @@ contributors: Nicolò Ribaudo
728763
</table>
729764
</emu-table>
730765
<p>In addition to the methods defined in <emu-xref href="#table-abstract-methods-of-module-records"></emu-xref> Cyclic Module Records have the additional methods listed in <emu-xref href="#table-cyclic-module-methods"></emu-xref></p>
731-
<emu-table id="table-cyclic-module-methods" caption="Additional Abstract Methods of Cyclic Module Records">
766+
<emu-table id="table-cyclic-module-methods" type="abstract methods" of="Cyclic Module Records" caption="Additional Abstract Methods of Cyclic Module Records">
732767
<table>
733768
<thead>
734769
<tr>
@@ -738,36 +773,55 @@ contributors: Nicolò Ribaudo
738773
<th>
739774
Purpose
740775
</th>
776+
<th>
777+
Definitions
778+
</th>
741779
</tr>
742780
</thead>
743-
<tr>
781+
<tr id="abstract-initializeenvironment">
782+
<td>InitializeEnvironment ( ): either a normal completion containing ~unused~ or a throw completion</td>
744783
<td>
745-
InitializeEnvironment()
784+
It initializes the Environment Record of the module, including resolving all imported bindings, and creates the module's execution context.
746785
</td>
747786
<td>
748-
Initialize the Environment Record of the module, including resolving all imported bindings, and create the module's execution context.
787+
Within this specification it has definitions in the following types; hosts may provide additional types with their own definitions:
788+
<emu-concrete-method-dfns for="InitializeEnvironment"></emu-concrete-method-dfns>
749789
</td>
750790
</tr>
751-
<tr>
791+
<tr id="abstract-executemodule">
792+
<td>
793+
ExecuteModule (
794+
optional _capability_: a PromiseCapability Record,
795+
): either a normal completion containing ~unused~ or a throw completion
796+
</td>
752797
<td>
753-
ExecuteModule( [ _promiseCapability_ ] )
798+
It evaluates 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.
754799
</td>
755800
<td>
756-
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.
801+
Within this specification it has definitions in the following types; hosts may provide additional types with their own definitions:
802+
<emu-concrete-method-dfns for="ExecuteModule"></emu-concrete-method-dfns>
757803
</td>
758804
</tr>
759-
<tr>
805+
<tr id="abstract-getoptionalindirectexportsmodulerequests">
760806
<td>
761-
<ins>GetOptionalIndirectExportsModuleRequests( [ _importedNames_ ])</ins>
807+
<ins>
808+
GetOptionalIndirectExportsModuleRequests(
809+
optional _importedNames_: ~all~ or a List of Strings,
810+
): a List of ModuleRequest Records
811+
</ins>
762812
</td>
763813
<td>
764-
<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>
814+
<p><ins>It computes the Module Requests for 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`.</ins></p>
765815

766816
<p><ins>This abstract method has the following default implementation:</ins></p>
767817
<emu-alg>
768818
1. <ins>Return a new empty List.</ins>
769819
</emu-alg>
770820
</td>
821+
<td>
822+
<ins>Within this specification it has definitions in the following types; hosts may provide additional types with their own definitions:</ins>
823+
<emu-concrete-method-dfns for="GetOptionalIndirectExportsModuleRequests"></emu-concrete-method-dfns>
824+
</td>
771825
</tr>
772826
</table>
773827
</emu-table>
@@ -850,7 +904,7 @@ contributors: Nicolò Ribaudo
850904
<emu-clause id="sec-LoadRequestedModules" type="concrete method">
851905
<h1>
852906
LoadRequestedModules (
853-
<ins>optional _importedNames_: ~all~ or an empty List,</ins>
907+
<ins>optional _importedNames_: ~all~ or a List of Strings,</ins>
854908
optional _hostDefined_: anything,
855909
): a Promise
856910
</h1>
@@ -1634,8 +1688,8 @@ contributors: Nicolò Ribaudo
16341688
<emu-clause id="sec-GetOptionalIndirectExportsModuleRequests" type="concrete method" number="3">
16351689
<h1>
16361690
<ins>
1637-
GetOptionalIndirectExportsModuleRequests (
1638-
_importedNames_: ~all~ or a List of Strings,
1691+
GetOptionalIndirectExportsModuleRequests(
1692+
optional _importedNames_: ~all~ or a List of Strings,
16391693
): a List of ModuleRequest Records
16401694
</ins>
16411695
</h1>

0 commit comments

Comments
 (0)