diff --git a/spec.html b/spec.html index 75b9a45d33..379b9fed33 100644 --- a/spec.html +++ b/spec.html @@ -9454,7 +9454,7 @@

[[Get]] ( _P_, _Receiver_ )

1. Assert: _binding_ is a ResolvedBinding Record. 1. Let _targetModule_ be _binding_.[[Module]]. 1. Assert: _targetModule_ is not *undefined*. - 1. If _binding_.[[BindingName]] is *"\*namespace\*"*, then + 1. If _binding_.[[BindingName]] is ~namespace~, then 1. Return ? GetModuleNamespace(_targetModule_). 1. Let _targetEnv_ be _targetModule_.[[Environment]]. 1. If _targetEnv_ is *undefined*, throw a *ReferenceError* exception. @@ -12188,9 +12188,8 @@

Runtime Semantics: BindingInitialization

Runtime Semantics: InitializeBoundName ( _name_, _value_, _environment_ )

-

The abstract operation InitializeBoundName takes arguments _name_, _value_, and _environment_. It performs the following steps when called:

+

The abstract operation InitializeBoundName takes arguments _name_ (a String), _value_, and _environment_. It performs the following steps when called:

- 1. Assert: Type(_name_) is String. 1. If _environment_ is not *undefined*, then 1. Perform _environment_.InitializeBinding(_name_, _value_). 1. Return NormalCompletion(*undefined*). @@ -19415,10 +19414,10 @@

Static Semantics: BoundNames

FunctionDeclaration : `function` `(` FormalParameters `)` `{` FunctionBody `}` - 1. Return « *"\*default\*"* ». + 1. Return « ~default~ ». -

*"\*default\*"* is used within this specification as a synthetic name for hoistable anonymous functions that are defined using export declarations.

+

~default~ is used within this specification as a synthetic name for hoistable anonymous functions that are defined using export declarations. It is never accessible from user code.

FormalParameters : [empty] @@ -20352,10 +20351,10 @@

Static Semantics: BoundNames

GeneratorDeclaration : `function` `*` `(` FormalParameters `)` `{` GeneratorBody `}` - 1. Return « *"\*default\*"* ». + 1. Return « ~default~ ». -

*"\*default\*"* is used within this specification as a synthetic name for hoistable anonymous functions that are defined using export declarations.

+

~default~ is used within this specification as a synthetic name for hoistable anonymous functions that are defined using export declarations. It is never accessible from user code.

@@ -20675,10 +20674,10 @@

Static Semantics: BoundNames

AsyncGeneratorDeclaration : `async` `function` `*` `(` FormalParameters `)` `{` AsyncGeneratorBody `}` - 1. Return « *"\*default\*"* ». + 1. Return « ~default~ ». -

*"\*default\*"* is used within this specification as a synthetic name for hoistable anonymous functions that are defined using export declarations.

+

~default~ is used within this specification as a synthetic name for hoistable anonymous functions that are defined using export declarations. It is never accessible from user code.

@@ -20962,7 +20961,7 @@

Static Semantics: BoundNames

ClassDeclaration : `class` ClassTail - 1. Return « *"\*default\*"* ». + 1. Return « ~default~ ». @@ -21337,9 +21336,9 @@

Static Semantics: BoundNames

AsyncFunctionDeclaration : `async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` - 1. Return « *"\*default\*"* ». + 1. Return « ~default~ ». - *"\*default\*"* is used within this specification as a synthetic name for hoistable anonymous functions that are defined using export declarations. + ~default~ is used within this specification as a synthetic name for hoistable anonymous functions that are defined using export declarations. It is never accessible from user code. @@ -22903,7 +22902,7 @@

Abstract Module Records

ResolveExport(_exportName_ [, _resolveSet_]) -

Return the binding of a name exported by this module. Bindings are represented by a ResolvedBinding Record, of the form { [[Module]]: Module Record, [[BindingName]]: String }. 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.

+

Return the binding of a name exported by this module. Bindings are represented by a ResolvedBinding Record, of the form { [[Module]]: Module Record, [[BindingName]]: String or ~default~ or ~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.

Each time this operation is called with a specific _exportName_, _resolveSet_ pair as arguments it must return the same result if it completes normally.

@@ -23347,10 +23346,10 @@

Source Text Module Records

[[ImportName]] - String + String | ~*~ - The name under which the desired binding is exported by the module identified by [[ModuleRequest]]. The value *"\*"* indicates that the import request is for the target module's namespace object. + The name under which the desired binding is exported by the module identified by [[ModuleRequest]]. The value ~*~ indicates that the import request is for the target module's namespace object. @@ -23408,7 +23407,7 @@

Source Text Module Records

*"mod"* - *"\*"* + ~*~ *"ns"* @@ -23496,10 +23495,10 @@

Source Text Module Records

[[ImportName]] - String | null + String | null | ~*~ - The name under which the desired binding is exported by the module identified by [[ModuleRequest]]. *null* if the |ExportDeclaration| does not have a |ModuleSpecifier|. *"\*"* indicates that the export request is for all exported bindings. + The name under which the desired binding is exported by the module identified by [[ModuleRequest]]. *null* if the |ExportDeclaration| does not have a |ModuleSpecifier|. ~*~ indicates that the export request is for all exported bindings. @@ -23586,7 +23585,7 @@

Source Text Module Records

*null* - *"\*default\*"* + ~default~ @@ -23603,7 +23602,7 @@

Source Text Module Records

*null* - *"\*default\*"* + ~default~ @@ -23685,7 +23684,7 @@

Source Text Module Records

*"mod"* - *"\*"* + ~*~ *null* @@ -23702,7 +23701,7 @@

Source Text Module Records

*"mod"* - *"\*"* + ~*~ *null* @@ -23734,13 +23733,13 @@

ParseModule ( _sourceText_, _realm_, _hostDefined_ )

1. Append _ee_ to _localExportEntries_. 1. Else, 1. Let _ie_ be the element of _importEntries_ whose [[LocalName]] is the same as _ee_.[[LocalName]]. - 1. If _ie_.[[ImportName]] is *"\*"*, then + 1. If _ie_.[[ImportName]] is ~*~ then 1. NOTE: This is a re-export of an imported module namespace object. 1. Append _ee_ to _localExportEntries_. 1. Else, 1. NOTE: This is a re-export of a single name. 1. Append the ExportEntry Record { [[ModuleRequest]]: _ie_.[[ModuleRequest]], [[ImportName]]: _ie_.[[ImportName]], [[LocalName]]: *null*, [[ExportName]]: _ee_.[[ExportName]] } to _indirectExportEntries_. - 1. Else if _ee_.[[ImportName]] is *"\*"* and _ee_.[[ExportName]] is *null*, then + 1. Else if _ee_.[[ImportName]] is ~*~ and _ee_.[[ExportName]] is *null*, then 1. Append _ee_ to _starExportEntries_. 1. Else, 1. Append _ee_ to _indirectExportEntries_. @@ -23788,7 +23787,7 @@

GetExportedNames ( [ _exportStarSet_ ] ) Concrete Method

ResolveExport ( _exportName_ [ , _resolveSet_ ] ) Concrete Method

The ResolveExport concrete method of a Source Text Module Record implements the corresponding Module Record abstract method.

ResolveExport attempts to resolve an imported binding to the actual defining module and local binding name. The defining module may be the module represented by the Module Record this method was invoked on or some other module that is imported by that module. The parameter _resolveSet_ is used to detect unresolved circular import/export paths. If a pair consisting of specific Module Record and _exportName_ is reached that is already in _resolveSet_, an import circularity has been encountered. Before recursively calling ResolveExport, a pair consisting of _module_ and _exportName_ is added to _resolveSet_.

-

If a defining module is found, a ResolvedBinding Record { [[Module]], [[BindingName]] } is returned. This record identifies the resolved binding of the originally requested export, unless this is the export of a namespace with no local binding. In this case, [[BindingName]] will be set to *"\*namespace\*"*. If no definition was found or the request is found to be circular, *null* is returned. If the request is found to be ambiguous, the string *"ambiguous"* is returned.

+

If a defining module is found, a ResolvedBinding Record { [[Module]], [[BindingName]] } is returned. This record identifies the resolved binding of the originally requested export, unless this is the export of a namespace with no local binding. In this case, [[BindingName]] will be set to ~namespace~. If no definition was found or the request is found to be circular, *null* is returned. If the request is found to be ambiguous, ~ambiguous~ is returned.

This abstract method performs the following steps:

@@ -23807,9 +23806,9 @@

ResolveExport ( _exportName_ [ , _resolveSet_ ] ) Concrete Method

1. For each ExportEntry Record _e_ of _module_.[[IndirectExportEntries]], do 1. If SameValue(_exportName_, _e_.[[ExportName]]) is *true*, then 1. Let _importedModule_ be ? HostResolveImportedModule(_module_, _e_.[[ModuleRequest]]). - 1. If _e_.[[ImportName]] is *"\*"*, then + 1. If _e_.[[ImportName]] is ~*~ then 1. Assert: _module_ does not provide the direct binding for this export. - 1. Return ResolvedBinding Record { [[Module]]: _importedModule_, [[BindingName]]: *"\*namespace\*"* }. + 1. Return ResolvedBinding Record { [[Module]]: _importedModule_, [[BindingName]]: ~namespace~ }. 1. Else, 1. Assert: _module_ imports a specific binding for this export. 1. Return _importedModule_.ResolveExport(_e_.[[ImportName]], _resolveSet_). @@ -23821,13 +23820,13 @@

ResolveExport ( _exportName_ [ , _resolveSet_ ] ) Concrete Method

1. For each ExportEntry Record _e_ of _module_.[[StarExportEntries]], do 1. Let _importedModule_ be ? HostResolveImportedModule(_module_, _e_.[[ModuleRequest]]). 1. Let _resolution_ be ? _importedModule_.ResolveExport(_exportName_, _resolveSet_). - 1. If _resolution_ is *"ambiguous"*, return *"ambiguous"*. + 1. If _resolution_ is ~ambiguous~, return ~ambiguous~. 1. If _resolution_ is not *null*, then 1. Assert: _resolution_ is a ResolvedBinding Record. 1. If _starResolution_ is *null*, set _starResolution_ to _resolution_. 1. Else, 1. Assert: There is more than one `*` import that includes the requested name. - 1. If _resolution_.[[Module]] and _starResolution_.[[Module]] are not the same Module Record or SameValue(_resolution_.[[BindingName]], _starResolution_.[[BindingName]]) is *false*, return *"ambiguous"*. + 1. If _resolution_.[[Module]] and _starResolution_.[[Module]] are not the same Module Record or SameValue(_resolution_.[[BindingName]], _starResolution_.[[BindingName]]) is *false*, return ~ambiguous~. 1. Return _starResolution_.
@@ -23841,7 +23840,7 @@

InitializeEnvironment ( ) Concrete Method

1. Let _module_ be this Source Text Module Record. 1. For each ExportEntry Record _e_ of _module_.[[IndirectExportEntries]], do 1. Let _resolution_ be ? _module_.ResolveExport(_e_.[[ExportName]]). - 1. If _resolution_ is *null* or *"ambiguous"*, throw a *SyntaxError* exception. + 1. If _resolution_ is *null* or ~ambiguous~, throw a *SyntaxError* exception. 1. Assert: _resolution_ is a ResolvedBinding Record. 1. Assert: All named exports from _module_ are resolvable. 1. Let _realm_ be _module_.[[Realm]]. @@ -23851,14 +23850,14 @@

InitializeEnvironment ( ) Concrete Method

1. For each ImportEntry Record _in_ of _module_.[[ImportEntries]], do 1. Let _importedModule_ be ! HostResolveImportedModule(_module_, _in_.[[ModuleRequest]]). 1. NOTE: The above call cannot fail because imported module requests are a subset of _module_.[[RequestedModules]], and these have been resolved earlier in this algorithm. - 1. If _in_.[[ImportName]] is *"\*"*, then + 1. If _in_.[[ImportName]] is ~*~ then 1. Let _namespace_ be ? GetModuleNamespace(_importedModule_). 1. Perform ! _env_.CreateImmutableBinding(_in_.[[LocalName]], *true*). 1. Call _env_.InitializeBinding(_in_.[[LocalName]], _namespace_). 1. Else, 1. Let _resolution_ be ? _importedModule_.ResolveExport(_in_.[[ImportName]]). - 1. If _resolution_ is *null* or *"ambiguous"*, throw a *SyntaxError* exception. - 1. If _resolution_.[[BindingName]] is *"\*namespace\*"*, then + 1. If _resolution_ is *null* or ~ambiguous~, throw a *SyntaxError* exception. + 1. If _resolution_.[[BindingName]] is ~namespace~, then 1. Let _namespace_ be ? GetModuleNamespace(_resolution_.[[Module]]). 1. Perform ! _env_.CreateImmutableBinding(_in_.[[LocalName]], *true*). 1. Call _env_.InitializeBinding(_in_.[[LocalName]], _namespace_). @@ -24186,7 +24185,7 @@

Static Semantics: ImportEntriesForModule

NameSpaceImport : `*` `as` ImportedBinding 1. Let _localName_ be the StringValue of |ImportedBinding|. - 1. Let _entry_ be the ImportEntry Record { [[ModuleRequest]]: _module_, [[ImportName]]: *"\*"*, [[LocalName]]: _localName_ }. + 1. Let _entry_ be the ImportEntry Record { [[ModuleRequest]]: _module_, [[ImportName]]: ~*~ [[LocalName]]: _localName_ }. 1. Return a new List containing _entry_. NamedImports : `{` `}` @@ -24295,18 +24294,18 @@

Static Semantics: BoundNames

ExportDeclaration : `export` `default` HoistableDeclaration 1. Let _declarationNames_ be the BoundNames of |HoistableDeclaration|. - 1. If _declarationNames_ does not include the element *"\*default\*"*, append *"\*default\*"* to _declarationNames_. + 1. If _declarationNames_ does not include the element ~default~, append ~default~ to _declarationNames_. 1. Return _declarationNames_. ExportDeclaration : `export` `default` ClassDeclaration 1. Let _declarationNames_ be the BoundNames of |ClassDeclaration|. - 1. If _declarationNames_ does not include the element *"\*default\*"*, append *"\*default\*"* to _declarationNames_. + 1. If _declarationNames_ does not include the element ~default~, append ~default~ to _declarationNames_. 1. Return _declarationNames_. ExportDeclaration : `export` `default` AssignmentExpression `;` - 1. Return « *"\*default\*"* ». + 1. Return « ~default~ ». @@ -24461,11 +24460,11 @@

Static Semantics: ExportEntries

ExportDeclaration : `export` `default` AssignmentExpression `;` - 1. Let _entry_ be the ExportEntry Record { [[ModuleRequest]]: *null*, [[ImportName]]: *null*, [[LocalName]]: *"\*default\*"*, [[ExportName]]: *"default"* }. + 1. Let _entry_ be the ExportEntry Record { [[ModuleRequest]]: *null*, [[ImportName]]: *null*, [[LocalName]]: ~default~, [[ExportName]]: *"default"* }. 1. Return a new List containing _entry_. -

*"\*default\*"* is used within this specification as a synthetic name for anonymous default export values.

+

~default~ is used within this specification as a synthetic name for anonymous default export values.

@@ -24474,13 +24473,13 @@

Static Semantics: ExportEntriesForModule

With parameter _module_.

ExportFromClause : `*` - 1. Let _entry_ be the ExportEntry Record { [[ModuleRequest]]: _module_, [[ImportName]]: *"\*"*, [[LocalName]]: *null*, [[ExportName]]: *null* }. + 1. Let _entry_ be the ExportEntry Record { [[ModuleRequest]]: _module_, [[ImportName]]: ~*~ [[LocalName]]: *null*, [[ExportName]]: *null* }. 1. Return a new List containing _entry_. ExportFromClause : `*` `as` IdentifierName 1. Let _exportName_ be the StringValue of |IdentifierName|. - 1. Let _entry_ be the ExportEntry Record { [[ModuleRequest]]: _module_, [[ImportName]]: *"\*"*, [[LocalName]]: *null*, [[ExportName]]: _exportName_ }. + 1. Let _entry_ be the ExportEntry Record { [[ModuleRequest]]: _module_, [[ImportName]]: ~*~ [[LocalName]]: *null*, [[ExportName]]: _exportName_ }. 1. Return a new List containing _entry_. NamedExports : `{` `}` @@ -24636,7 +24635,7 @@

Runtime Semantics: Evaluation

1. Let _value_ be ? BindingClassDeclarationEvaluation of |ClassDeclaration|. 1. Let _className_ be the sole element of BoundNames of |ClassDeclaration|. - 1. If _className_ is *"\*default\*"*, then + 1. If _className_ is ~default~, then 1. Let _env_ be the running execution context's LexicalEnvironment. 1. Perform ? InitializeBoundName(*"\*default\*"*, _value_, _env_). 1. Return NormalCompletion(~empty~).