Well-known symbols are built-in Symbol values that are explicitly referenced by algorithms of this specification. They are typically used as the keys of properties whose values serve as extension points of a specification algorithm.
Within this specification a well-known symbol is referred to by using a notation of the form @@name, where "name" is one of the values listed in table below:
Specification Name | [[Description]] | Value and Purpose |
---|---|---|
@@resolve | "Reflect.Loader.resolve" | A function valued property that is the resolve hook function of loader’s instances. |
@@fetch | "Reflect.Loader.fetch" | A function valued property that is the fetch hook function of loader’s instances. |
@@translate | "Reflect.Loader.translate" | A function valued property that is the translate hook function of loader’s instances. |
@@instantiate | "Reflect.Loader.instantiate" | A function valued property that is the instantiate hook function of loader’s instances. |
This spec makes heavy use of promises, and adopts the notational conventions established in the promises guide.
Transforming p with a new pass-through promise is a shorthand for wrapping the promise to avoid exposing the original promise. It represents the following step:
The Loader constructor is the initial value of the Loader property of the the Reflect object. When called as a constructor it creates and initializes a new Loader object. Reflect.Loader is not intended to be called as a function and will throw an exception when called in that manner.
The Reflect.Loader constructor is designed to be subclassable. It may be used as the value in an extends clause of a class definition. Subclass constructors that intend to inherit the specified Loader behaviour must include a super call to the Reflect.Loader constructor to create and initialize the subclass instance with the internal state necessary to support the Reflect.Loader.prototype built-in methods.
The initial value of Reflect.Loader.prototype.constructor is Reflect.Loader.
The following steps are taken:
The following steps are taken:
The following steps are taken:
Reflect.Loader.prototype.registry is an accessor property whose set accessor function is undefined. Its get accessor function performs the following steps:
The initial value of the @@toStringTag property is the String value "Object".
This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
Loader instances are ordinary objects that inherit properties from the
Loader instances are initially created with the internal slots described in the following table:
Internal Slot | Value Type (non-normative) | Description (non-normative) |
---|---|---|
[[Realm]] | The realm this loader belongs to. | |
[[Registry]] | An object | An instance of |
The abstract operation GetRegistryEntry with arguments registry and key performs the following steps:
Internal Slot | Value Type (non-normative) | Description (non-normative) |
---|---|---|
[[Key]] | String | The resolved module key. |
[[State]] | "fetch" , "translate" , "instantiate" , "link" , "ready" |
A constant value to indicating which phase the entry is at. |
[[Metadata]] | Object or undefined |
The metadata object passed through the pipeline. |
[[Fetch]] | Promise or undefined |
A promise for the result of [[#request-fetch]]. |
[[Translate]] | Promise or undefined |
A promise for the result of [[#request-translate]]. |
[[Instantiate]] | Promise or undefined |
A promise for the result of [[#request-instantiate]]. |
[[Dependencies]] | undefined ), or undefined . |
Table mapping unresolved names to their resolved modules. |
[[Module]] | undefined |
The undefined . |
[[Error]] | Any or nothing | An error that was encountered during one of the phases of the loading pipeline; nothing if no error has been encountered. |
The
When Registry is called with argument loader, the following steps are taken:
The value of the [[Prototype]] internal slot of the
Besides the internal slots and the length property (whose value is 0), the
The value of Registry.prototype is %RegistryPrototype%.
This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
The initial value of Registry.prototype.constructor is %
When the @@iterator method is called it returns an Iterator object (ES2015 25.1.1.2) that iterates over the registry entries of the [[RegistryData]] internal slot, returning each entry as a key value pair. The following steps are taken:
The following steps are taken:
The following steps are taken:
The following steps are taken:
The following steps are taken:
The following steps are taken:
The following steps are taken:
Internal Slot | Value Type (non-normative) | Description (non-normative) |
---|---|---|
[[RegistryData]] | The registry of installed modules. | |
[[Loader]] | An object | The loader this registry belongs to. |
A reflective module record is a kind of module record. It extends
Internal Slot | Value Type (non-normative) | Description (non-normative) |
---|---|---|
[[LocalExports]] | A |
The set of exported names stored in this module's environment. |
[[IndirectExports]] | A |
The set of re-exported bindings. This ensures that |
[[Evaluate]] | A function object or undefined |
A thunk to call when the the module is evaluated, or undefined if the module is already evaluated. |
{ }
{ const: true }
{ value: 42 }
{ value: 42, const: true }
{ module: m, import: "foo" }
The following steps are taken:
Reflective modules are always already instantiated.
The Module constructor is the initial value of the Module property of the the Reflect object. When called as a constructor it creates and initializes a new Module object. Reflect.Module is not intended to be called as a function and will throw an exception when called in that manner.
The Reflect.Module constructor is designed to be subclassable. It may be used as the value in an extends clause of a class definition. Subclass constructors that intend to inherit the specified Module behaviour must include a super call to the Reflect.Module constructor to create and initialize the subclass instance with the internal state necessary to integrated with loaders.
When Reflect.Module is called with arguments descriptors, executor, and evaluate, the following steps are taken:
The value of the [[Prototype]] internal slot of the Reflect.Module constructor is the intrinsic object %FunctionPrototype%.
Besides the internal slots and the length property (whose value is 0), the Reflect.Loader constructor has the following properties:
TODO: way to force evaluation of a module namespace exotic object (Reflect.Module.evaluate(m)
? m[Reflect.Module.evaluate]()
?)
The value of Reflect.Module.prototype is an ordinary object with a null [[Prototype]].
This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
Reflect.Module instances are module namespace exotic objects.