?
u
/
Well-known intrinsics are built-in objects that are explicitly referenced by the algorithms of this specification and which usually have
Within this specification a reference such as %name% means the intrinsic object, associated with the current
Intrinsic Name | Global Name | ECMAScript Language Association |
---|---|---|
%AbstractModuleSource% |
The %AbstractModuleSource% |
|
|
AggregateError
|
The AggregateError |
|
Array
|
The Array |
|
ArrayBuffer
|
The ArrayBuffer |
|
The prototype of Array iterator objects ( |
|
|
The prototype of async-from-sync iterator objects ( |
|
|
The |
|
|
The |
|
%AsyncGeneratorPrototype% |
The prototype of async generator objects ( |
|
|
An object that all standard built-in async iterator objects indirectly inherit from | |
|
Atomics
|
The Atomics object ( |
|
BigInt
|
The BigInt |
|
BigInt64Array
|
The BigInt64Array |
|
BigUint64Array
|
The BigUint64Array |
|
Boolean
|
The Boolean |
|
DataView
|
The DataView |
|
Date
|
The Date |
|
decodeURI
|
The decodeURI function ( |
|
decodeURIComponent
|
The decodeURIComponent function ( |
|
encodeURI
|
The encodeURI function ( |
|
encodeURIComponent
|
The encodeURIComponent function ( |
|
Error
|
The Error |
|
eval
|
The eval function ( |
|
EvalError
|
The EvalError |
|
FinalizationRegistry
|
The |
|
Float32Array
|
The Float32Array |
|
Float64Array
|
The Float64Array |
|
The prototype of For-In iterator objects ( |
|
|
Function
|
The Function |
|
The |
|
%GeneratorPrototype% |
The prototype of generator objects ( |
|
|
Int8Array
|
The Int8Array |
|
Int16Array
|
The Int16Array |
|
Int32Array
|
The Int32Array |
|
isFinite
|
The isFinite function ( |
|
isNaN
|
The isNaN function ( |
|
An object that all standard built-in iterator objects indirectly inherit from | |
|
JSON
|
The JSON object ( |
|
Map
|
The Map |
|
The prototype of Map iterator objects ( |
|
|
Math
|
The Math object ( |
|
Number
|
The Number |
|
Object
|
The Object |
|
parseFloat
|
The parseFloat function ( |
|
parseInt
|
The parseInt function ( |
|
Promise
|
The Promise |
|
Proxy
|
The Proxy |
|
RangeError
|
The RangeError |
|
ReferenceError
|
The ReferenceError |
|
Reflect
|
The Reflect object ( |
|
RegExp
|
The RegExp |
|
The prototype of RegExp String Iterator objects ( |
|
|
Set
|
The Set |
|
The prototype of Set iterator objects ( |
|
|
SharedArrayBuffer
|
The SharedArrayBuffer |
|
String
|
The String |
|
The prototype of String iterator objects ( |
|
|
Symbol
|
The Symbol |
|
SyntaxError
|
The SyntaxError |
|
A |
|
|
The super class of all typed Array |
|
|
TypeError
|
The TypeError |
|
Uint8Array
|
The Uint8Array |
|
Uint8ClampedArray
|
The Uint8ClampedArray |
|
Uint16Array
|
The Uint16Array |
|
Uint32Array
|
The Uint32Array |
|
URIError
|
The URIError |
|
WeakMap
|
The WeakMap |
|
WeakRef
|
The |
|
WeakSet
|
The WeakSet |
Additional entries in
The abstract operation EvaluateImportCall takes arguments specifierExpression (a
The abstract operation ContinueDynamicImport takes arguments promiseCapability (a import()
A ModuleRequest Record represents a request to import a module up to a given phase. It consists of the following fields:
Field Name | Value Type | Meaning |
---|---|---|
[[Specifier]] | a String | The module specifier |
[[Phase]] |
|
The target import phase |
The Strings
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 When called multiple times on the same The returned object should have a [[Prototype]] internal slot whose value is For |
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
An ImportEntry Record is a
Field Name | Value Type | Meaning |
---|---|---|
[[ModuleRequest]] | a String |
String value of the |
[[ImportName]] |
a String |
The name under which the desired binding is exported by the module identified by [[ModuleRequest]]. The value |
[[LocalName]] | a String | The name that is used to locally access the imported value from within the importing module. |
Import Statement Form | [[ModuleRequest]] | [[ImportName]] | [[LocalName]] |
---|---|---|---|
import v from "mod";
|
|
|
|
import * as ns from "mod";
|
|
|
|
import {x} from "mod";
|
|
|
|
import {x as v} from "mod";
|
|
|
|
import "mod";
|
An |
The specifier (a String), moduleRequest (a
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 specifiermoduleRequest.[[Specifier]]) pairs may map to the same
The abstract operation FinishLoadingImportedModule takes arguments referrer (a specifier (a String), moduleRequest (a
The
An implementation of HostGetModuleSourceName must conform to the following requirements:
The
Module Source Objects represent modules in their source import phase, which are not linked, instantiated or executed.
A Module Source Object is an object for which
All Module Source Objects should have a prototype of %AbstractModuleSource%.prototype.
The %AbstractModuleSource%
super
call to it.This function performs the following steps when called:
The %AbstractModuleSource% intrinsic object:
The initial value of %AbstractModuleSource%.prototype
is the
This property has the attributes { [[Writable]]:
The %AbstractModuleSource% prototype object:
The initial value of %AbstractModuleSource%.prototype.constructor
is %AbstractModuleSource%.
%AbstractModuleSource%.prototype [@@toStringTag]
is an
This property has the attributes { [[Enumerable]]:
The initial value of the
HostEnqueueGenericJob(...)
HostEnqueueTimeoutJob(...)
HostGrowSharedArrayBuffer(...)
HostResizeArrayBuffer(...)
© 2024 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.