diff --git a/spec.html b/spec.html index 540e776fe7..637c6078ad 100644 --- a/spec.html +++ b/spec.html @@ -3232,6 +3232,16 @@

Well-Known Intrinsic Objects

ECMAScript Language Association + + + %AbstractModuleSource% + + + + + The %AbstractModuleSource% constructor () + + %AggregateError% @@ -19320,7 +19330,7 @@

Runtime Semantics: Evaluation

1. Return ? EvaluateImportCall(|AssignmentExpression|, ~evaluation~). - ImportCall : `import` `.` `source` `(` AssignmentExpression[+In, ?Yield, ?Await] `)` + ImportCall : `import` `.` `source` `(` AssignmentExpression `)` 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~source~). @@ -19328,15 +19338,16 @@

Runtime Semantics: Evaluation

EvaluateImportCall ( - _specifierExpression_: a ParseNode, - _phase_: ~source~ or ~evaluation~ + _specifierExpression_: a Parse Node, + _phase_: ~source~ or ~evaluation~, ): either a normal completion containing a Promise or a throw completion

-
+
+
1. Let _referrer_ be GetActiveScriptOrModule(). 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. - 1. Let _specifierRef_ be the result of evaluating _specifierExpression_. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. 1. Let _specifier_ be ? GetValue(_specifierRef_). 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). 1. Let _specifierString_ be Completion(ToString(_specifier_)). @@ -19367,9 +19378,9 @@

1. If _phase_ is ~source~, then 1. Let _moduleSourceCompletion_ be Completion(_module_.GetModuleSource()). 1. If _moduleSourceCompletion_ is an abrupt completion, then - 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _moduleSourceCompletion_.[[Value]] »). + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _moduleSourceCompletion_.[[Value]] »). 1. Else, - 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _moduleSourceCompletion_.[[Value]] »). + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _moduleSourceCompletion_.[[Value]] »). 1. Return ~unused~. 1. Let _loadPromise_ be _module_.LoadRequestedModules(). 1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that captures _promiseCapability_ and performs the following steps when called: @@ -25926,43 +25937,41 @@

ModuleRequest Records

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]] - - ~source~ or ~evaluation~ - - The target import phase -
+ Field Name + + Value Type + + Meaning +
+ [[Specifier]] + + a String + + The module specifier +
+ [[Phase]] + + ~source~ or ~evaluation~ + + The target import phase +
@@ -25988,7 +25997,7 @@

Static Semantics: ModuleRequests ( ): a List of ModuleRequest Records

1. For each ModuleRequest Record _mr_ of _additionalRequests_, do 1. Let _found_ be *false*. 1. For each ModuleRequest Record _mr2_ of _requests_, do - 1. If _mr_.[[Specifer]] is _mr2_.[[Specifer]] and _mr_.[[Phase]] is _mr2_.[[Phase]], then + 1. If _mr_.[[Specifier]] is _mr2_.[[Specifier]] and _mr_.[[Phase]] is _mr2_.[[Phase]], then 1. Assert: _found_ is *false*. 1. Set _found_ to *true*. 1. If _found_ is *false*, then @@ -26002,19 +26011,19 @@

Static Semantics: ModuleRequests ( ): a List of ModuleRequest Records

ImportDeclaration : `import` ImportClause FromClause `;` 1. Let _specifier_ be SV of |FromClause|. - 1. Return a List whose sole element is the ModuleRequest Record { [[Specifer]]: _specifier_, [[Phase]]: ~evaluation~ }. + 1. Return a List whose sole element is the ModuleRequest Record { [[Specifier]]: _specifier_, [[Phase]]: ~evaluation~ }. ImportDeclaration : `import` `source` ImportedBinding FromClause `;` 1. Let _specifier_ be SV of |FromClause|. - 1. Return a List whose sole element is the ModuleRequest Record { [[Specifer]]: _specifier_, [[Phase]]: ~source~ }. + 1. Return a List whose sole element is the ModuleRequest Record { [[Specifier]]: _specifier_, [[Phase]]: ~source~ }. ExportDeclaration : `export` ExportFromClause FromClause `;` 1. Let _specifier_ be SV of |FromClause|. - 1. Return a List whose sole element is the ModuleRequest Record { [[Specifer]]: _specifier_, [[Phase]]: ~evaluation~ }. + 1. Return a List whose sole element is the ModuleRequest Record { [[Specifier]]: _specifier_, [[Phase]]: ~evaluation~ }. ExportDeclaration : @@ -26034,32 +26043,30 @@

Static Semantics: ModuleRequests ( ): a List of ModuleRequest Records

ModuleSource Records

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. Source Text Module Records are usually represented by the *"ModuleSource"* class. -
+ Field Name + + Value Type + + Meaning +
+ [[SourceClassName]] + + a String + + The unique source class name string used to represent this module source. Source Text Module Records are usually represented by the *"ModuleSource"* class. +
@@ -26145,10 +26152,10 @@

Abstract Module Records

GetModuleSource() -

It returns either a normal completion completion for the ModuleSource Object corresponding to this source Module Record's source phase (), or a throw completion.

+

It returns either a normal completion containing the ModuleSource Object corresponding to this source Module Record's source phase (), or a throw completion.

When called multiple times on the same Module Record, if GetModuleSource() returns a normal completion it must always return a normal completion containing the same object.

The returned object should be an instance of a subclass of %AbstractModuleSource%, and it must have an internal slot [[ModuleSourceRecord]].

-

Module Record's that do not have a source represemtation must always return a throw completion containing a *ReferenceError*.

+

Module Records that do not have a source represemtation must always return a throw completion containing a *ReferenceError*.

@@ -26485,7 +26492,7 @@

InnerModuleLoading ( _state_: a GraphLoadingState Record, _module_: a Module Record, - _loadRecursively_: a Boolean + _loadRecursively_: a Boolean, ): ~unused~

@@ -26503,7 +26510,7 @@

1. If _module_.[[LoadedModules]] contains a Record whose [[Specifier]] is _required_.[[Specifier]], then 1. Let _record_ be that Record. 1. Let _innerLoadRecursively_ be *true*. - 1. If _required_.[[Phase]] is ~source~ set _innerLoadRecursively_ to *false*. + 1. If _required_.[[Phase]] is ~source~, set _innerLoadRecursively_ to *false*. 1. Perform InnerModuleLoading(_state_, _record_.[[Module]], _innerLoadRecursively_). 1. Else, 1. Perform HostLoadImportedModule(_module_, _required_, _state_.[[HostDefined]], _state_). @@ -26537,7 +26544,7 @@

1. If _state_.[[IsLoading]] is *false*, return ~unused~. 1. If _moduleCompletion_ is a normal completion, then 1. Let _loadRecursively_ be *true*. - 1. If _phase_ is ~source~ set _loadRecursively_ to *false*. + 1. If _phase_ is ~source~, set _loadRecursively_ to *false*. 1. Perform InnerModuleLoading(_state_, _moduleCompletion_.[[Value]], _loadRecursively_). 1. Else, 1. Set _state_.[[IsLoading]] to *false*. @@ -26693,7 +26700,7 @@

1. Append _module_ to _stack_. 1. For each ModuleRequest Record _required_ of _module_.[[RequestedModules]], do 1. Let _requiredModule_ be GetImportedModule(_module_, _required_.[[Specifier]]). - 1. If _requiredModule_.[[Phase]] is ~evaluation~, then + 1. If _required_.[[Phase]] is ~evaluation~, then 1. Set _index_ to ? InnerModuleEvaluation(_requiredModule_, _stack_, _index_). 1. If _requiredModule_ is a Cyclic Module Record, then 1. Assert: _requiredModule_.[[Status]] is one of ~evaluating~, ~evaluating-async~, or ~evaluated~. @@ -27396,7 +27403,7 @@

Source Text Module Records

[[ImportName]] - a String or ~namespace-object~ + a String, ~source~, or ~namespace-object~ The name under which the desired binding is exported by the module identified by [[ModuleRequest]]. The value ~namespace-object~ indicates that the import request is for the target module's namespace object. @@ -27804,9 +27811,7 @@

-

- GetModuleSource ( ): either a normal completion containing an Object or a throw completion -

+

GetModuleSource ( ): either a normal completion containing an Object or a throw completion

for
a Source Text Module Record _module_
@@ -46959,7 +46964,7 @@

%AbstractModuleSource%.prototype.constructor

get %AbstractModuleSource%.prototype [ @@toStringTag ]

-

%AbstractModuleSource%.prototype `[@@toStringTag]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

+

%AbstractModuleSource%`.prototype[@@toStringTag]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

1. Let _O_ be the *this* value. 1. If _O_ is not an Object, return *undefined*.