?
u
/
The abstract operation EvaluateImportCall takes arguments specifier and options. It performs the following steps when called:
A DynamicImportState Record is a
Field Name | Value Type | Meaning |
---|---|---|
[[PromiseCapability]] |
a |
The promise to resolve when the dynamic import finishes. |
[[Phase]] |
|
The target import phase. It's phase: "source" option, and |
The abstract operation ContinueDynamicImport takes arguments promiseCapability (a , state (a import()
A ModuleRequest Record represents the request to import a module up to a given phase. It consists of the following fields:
Field Name | Value Type | Meaning |
---|---|---|
[[Specifier]] | String | The module specifier |
[[Phase]] |
|
The target import phase |
The Strings
A ModuleSource Record represents the request to import a module up to a given phase. It consists of the following fields:
Field Name | Value Type | Meaning |
---|---|---|
[[SourceClassName]] | String |
The unique source class name string used to represent this module source. |
[[HostDefined]] |
anything (default value is |
Field reserved for use by |
A Module Record encapsulates structural information about the imports and exports of a single module. This information is used to link the imports and exports of sets of connected modules. A Module Record includes four fields that are only used when evaluating a module.
For specification purposes Module Record values are values of the
Module Record defines the fields listed in
Field Name | Value Type | Meaning |
---|---|---|
[[Realm]] |
a |
The |
[[Environment]] |
a |
The |
[[Namespace]] |
an Object or |
The Module Namespace Object ( |
[[HostDefined]] |
anything (default value is |
Field reserved for use by |
Method | Purpose |
---|---|
LoadRequestedModules( [ hostDefined ] ) |
Prepares the module for linking by recursively loading all its dependencies, and returns a promise. |
GetExportedNames([exportStarSet]) |
Return a list of all names that are either directly or indirectly exported from this module. LoadRequestedModules must have completed successfully prior to invoking this method. |
ResolveExport(exportName [, resolveSet]) |
Return the binding of a name exported by this module. Bindings are represented by a ResolvedBinding Record, of the form { [[Module]]: Each time this operation is called with a specific exportName, resolveSet pair as arguments it must return the same result. LoadRequestedModules must have completed successfully prior to invoking this method. |
Link() |
Prepare the module for evaluation by transitively resolving all module dependencies and creating a LoadRequestedModules must have completed successfully prior to invoking this method. |
Evaluate() |
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, Link must have completed successfully prior to invoking this method. |
GetModuleSource() |
It returns either a |
A Cyclic Module Record is used to represent information about a module that can participate in dependency cycles with other modules that are subclasses of the
In addition to the fields defined in
Field Name | Value Type | Meaning |
---|---|---|
[[Status]] |
|
Initially |
[[EvaluationError]] |
a |
A |
[[DFSIndex]] |
an |
Auxiliary field used during Link and Evaluate only. If [[Status]] is |
[[DFSAncestorIndex]] |
an |
Auxiliary field used during Link and Evaluate only. If [[Status]] is |
[[RequestedModules]] |
a |
A |
[[CycleRoot]] |
a |
The first visited module of the cycle, the root DFS ancestor of the strongly connected component. For a module not in a cycle this would be the module itself. Once Evaluate has completed, a module's [[DFSAncestorIndex]] is equal to the [[DFSIndex]] of its [[CycleRoot]]. |
[[HasTLA]] | a Boolean |
Whether this module is individually asynchronous (for example, if it's a |
[[AsyncEvaluation]] | a Boolean |
Whether this module is either itself asynchronous or has an asynchronous dependency. Note: The order in which this field is set is used to order queued executions, see |
[[TopLevelCapability]] |
a |
If this module is the [[CycleRoot]] of some cycle, and Evaluate() was called on some module in that cycle, this field contains the |
[[AsyncParentModules]] |
a |
If this module or a dependency has [[HasTLA]] |
[[PendingAsyncDependencies]] |
an |
If this module has any asynchronous dependencies, this tracks the number of asynchronous dependency modules remaining to execute for this module. A module with asynchronous dependencies will be executed when this field reaches 0 and there are no execution errors. |
The LoadRequestedModules concrete method of a
The abstract operation InnerModuleLoading takes arguments state (a
The abstract operation ContinueModuleLoading takes arguments state (a
The Link concrete method of a
The abstract operation InnerModuleLinking takes arguments module (a
The Evaluate concrete method of a
The abstract operation InnerModuleEvaluation takes arguments module (a
The GetModuleSource concrete method of a
It performs the following steps when called:
The InitializeEnvironment concrete method of a
The
An example of when referrer can be a
<button type="button" onclick="import('./foo.mjs')">Click me</button>
there will be no import()
An implementation of HostLoadImportedModule must conform to the following requirements:
The actual process performed is
The abstract operation FinishLoadingImportedModule takes arguments referrer (a
The
Module Source Objects represent modules in their source import phase, which are not linked, instantiated or executed.
All Module Source Objects should have a prototype of
The %AbstractModuleSource%
super
call to it.This function performs the following steps when called:
The
The
The initial value of .prototype
is the
This property has the attributes { [[Writable]]:
The %AbstractModuleSource% prototype object:
The initial value of .prototype.constructor
is
[@@toStringTag]
is an
This property has the attributes { [[Enumerable]]:
The initial value of the
[[HostDefined]] on
[[HostDefined]] on
[[HostDefined]] on
[[HostDefined]] on
[[HostDefined]] on
[[HostSynchronizesWith]] on Candidate Executions: See
[[IsHTMLDDA]]: See
© 2023 Luca Casonato, Guy Bedford, Nicolò Ribaudo
All Software contained in this document ("Software") is protected by copyright and is being made available under the "BSD License", included below. This Software may be subject to third party rights (rights from parties other than Ecma International), including patent rights, and no licenses under such third party rights are granted under this license even if the third party concerned is a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS AVAILABLE AT https://ecma-international.org/memento/codeofconduct.htm FOR INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO IMPLEMENT ECMA INTERNATIONAL STANDARDS.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.