Stage 1 Draft / April 19, 2018

ECMAScript export ns from

Introduction

This proposal adds a new form of "export from" which exports another module's namespace exotic object as an exported name of another, filling a use case similar to the use cases for existing "export from" forms.

See the proposal repository for motivations and more information.

Note 1

This proposal is closely related to the export default from proposal.

Note 2

This spec proposal is written as a diff against the existing ECMAScript specification.

1Module Namespace Exotic Objects

A module namespace object is an exotic object that exposes the bindings exported from an ECMAScript Module (See 2.1.2). There is a one-to-one correspondence between the String-keyed own properties of a module namespace exotic object and the binding names exported by the Module. The exported bindings include any bindings that are indirectly exported using export * export items. Each String-valued own property key is the StringValue of the corresponding exported binding name. These are the only String-keyed properties of a module namespace exotic object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: false }. Module namespace objects are not extensible.

1.1[[Get]] ( P, Receiver )

When the [[Get]] internal method of a module namespace exotic object O is called with property key P and ECMAScript language value Receiver, the following steps are taken:

  1. Assert: IsPropertyKey(P) is true.
  2. If Type(P) is Symbol, then
    1. Return ? OrdinaryGet(O, P, Receiver).
  3. Let exports be O.[[Exports]].
  4. If P is not an element of exports, return undefined.
  5. Let m be O.[[Module]].
  6. Let binding be ! m.ResolveExport(P, « »).
  7. Assert: binding is a ResolvedBinding Record.
  8. Let targetModule be binding.[[Module]].
  9. Assert: targetModule is not undefined.
  10. If binding.[[BindingName]] is "*namespace*", then
    1. Return ? GetModuleNamespace(targetModule).
  11. Else,
    1. Let targetEnv be targetModule.[[Environment]].
    2. If targetEnv is undefined, throw a ReferenceError exception.
    3. Let targetEnvRec be targetEnv's EnvironmentRecord.
    4. Return ? targetEnvRec.GetBindingValue(binding.[[BindingName]], true).
  12. Let targetEnv be targetModule.[[Environment]].
  13. If targetEnv is undefined, throw a ReferenceError exception.
  14. Let targetEnvRec be targetEnv's EnvironmentRecord.
  15. Return ? targetEnvRec.GetBindingValue(binding.[[BindingName]], true).
Note

ResolveExport is idempotent and side-effect free. An implementation might choose to pre-compute or cache the ResolveExport results for the [[Exports]] of each module namespace exotic object.

2ECMAScript Language: Scripts and Modules

Note
This is Chapter 15 in the current spec.

2.1Modules

2.1.1Module Semantics

2.1.1.1Abstract Module Records

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 Record specification type and can be thought of as existing in a simple object-oriented hierarchy where Module Record is an abstract class with concrete subclasses. This specification only defines a single Module Record concrete subclass named Source Text Module Record. Other specifications and implementations may define additional Module Record subclasses corresponding to alternative module definition facilities that they defined.

Module Record defines the fields listed in Table 1. All Module Definition subclasses include at least those fields. Module Record also defines the abstract method list in Table 2. All Module definition subclasses must provide concrete implementations of these abstract methods.

Table 1: Module Record Fields
Field Name Value Type Meaning
[[Realm]] Realm Record | undefined The Realm within which this module was created. undefined if not yet assigned.
[[Environment]] Lexical Environment | undefined The Lexical Environment containing the top level bindings for this module. This field is set when the module is instantiated.
[[Namespace]] Object | undefined The Module Namespace Object (3) if one has been created for this module. Otherwise undefined.
[[HostDefined]] Any, default value is undefined. Field reserved for use by host environments that need to associate additional information with a module.
Table 2: Abstract Methods of Module Records
Method Purpose
GetExportedNames(exportStarSet) Return a list of all names that are either directly or indirectly exported from this module.
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.

This operation must be idempotent if it completes normally. Each time it is called with a specific exportName, resolveSet pair as arguments it must return the same result.

Instantiate()

Prepare the module for evaluation by transitively resolving all module dependencies and creating a module Environment Record.

Evaluate()

If this module has already been evaluated successfully, return undefined; if it has already been evaluated unsuccessfully, throw the exception that was produced. Otherwise, transitively evaluate all module dependencies of this module and then evaluate this module.

Instantiate must have completed successfully prior to invoking this method.

2.1.1.2Source Text Module Records

A Source Text Module Record is used to represent information about a module that was defined from ECMAScript source text (10) that was parsed using the goal symbol Module. Its fields contain digested information about the names that are imported by the module and its concrete methods use this digest to link, instantiate, and evaluate the module.

A Source Text Module Record can exist in a module graph with other subclasses of the abstract Module Record type. However, non-source text Module Records must not participate in dependency cycles with Source Text Module Records.

In addition to the fields, defined in Table 1, Source Text Module Records have the additional fields listed in Table 3. Each of these fields is initially set in ParseModule.

Table 3: Additional Fields of Source Text Module Records
Field Name Value Type Meaning
[[ECMAScriptCode]] a Parse Node The result of parsing the source text of this module using Module as the goal symbol.
[[RequestedModules]] List of String A List of all the ModuleSpecifier strings used by the module represented by this record to request the importation of a module. The List is source code occurrence ordered.
[[ImportEntries]] List of ImportEntry Records A List of ImportEntry records derived from the code of this module.
[[LocalExportEntries]] List of ExportEntry Records A List of ExportEntry records derived from the code of this module that correspond to declarations that occur within the module.
[[IndirectExportEntries]] List of ExportEntry Records A List of ExportEntry records derived from the code of this module that correspond to reexported imports that occur within the module or exports from export * as namespace declarations.
[[StarExportEntries]] List of ExportEntry Records A List of ExportEntry records derived from the code of this module that correspond to export * declarations that occur within the module, not including export * as namespace declarations.
[[Status]] String Initially "uninstantiated". Transitions to "instantiating", "instantiated", "evaluating", "evaluated" (in that order) as the module progresses throughout its lifecycle.
[[EvaluationError]] An abrupt completion | undefined A completion of type throw representing the exception that occurred during evaluation. undefined if no exception occurred or if [[Status]] is not "evaluated".
[[DFSIndex]] Integer | undefined Auxiliary field used during Instantiate and Evaluate only. If [[Status]] is "instantiating" or "evaluating", this non-negative number records the point at which the module was first visited during the ongoing depth-first traversal of the dependency graph.
[[DFSAncestorIndex]] Integer | undefined Auxiliary field used during Instantiate and Evaluate only. If [[Status]] is "instantiating" or "evaluating", this is either the module's own [[DFSIndex]] or that of an "earlier" module in the same strongly connected component.

An ImportEntry Record is a Record that digests information about a single declarative import. Each ImportEntry Record has the fields defined in Table 4:

Table 4: ImportEntry Record Fields
Field Name Value Type Meaning
[[ModuleRequest]] String String value of the ModuleSpecifier of the ImportDeclaration.
[[ImportName]] 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.
[[LocalName]] String The name that is used to locally access the imported value from within the importing module.
Note 1

Table 5 gives examples of ImportEntry records fields used to represent the syntactic import forms:

Table 5 (Informative): Import Forms Mappings to ImportEntry Records
Import Statement Form [[ModuleRequest]] [[ImportName]] [[LocalName]]
import v from "mod"; "mod" "default" "v"
import * as ns from "mod"; "mod" "*" "ns"
import {x} from "mod"; "mod" "x" "x"
import {x as v} from "mod"; "mod" "x" "v"
import "mod"; An ImportEntry Record is not created.

An ExportEntry Record is a Record that digests information about a single declarative export. Each ExportEntry Record has the fields defined in Table 6:

Table 6: ExportEntry Record Fields
Field Name Value Type Meaning
[[ExportName]] String | null The name used to export this binding by this module.
[[ModuleRequest]] String | null The String value of the ModuleSpecifier of the ExportDeclaration. null if the ExportDeclaration does not have a ModuleSpecifier.
[[ImportName]] 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.
[[LocalName]] String | null The name that is used to locally access the exported value from within the importing module. null if the exported value is not locally accessible from within the module.
Note 2

Table 42 gives examples of the ExportEntry record fields used to represent the syntactic export forms:

Table 7 (Informative): Export Forms Mappings to ExportEntry Records
Export Statement Form [[ExportName]] [[ModuleRequest]] [[ImportName]] [[LocalName]]
export var v; "v" null null "v"
export default function f(){} "default" null null "f"
export default function(){} "default" null null "*default*"
export default 42; "default" null null "*default*"
export {x}; "x" null null "x"
export {v as x}; "x" null null "v"
export {x} from "mod"; "x" "mod" "x" null
export {v as x} from "mod"; "x" "mod" "v" null
export * from "mod"; null "mod" "*" null
export * as ns from "mod"; "ns" "mod" "*" null

The following definitions specify the required concrete methods and other abstract operations for Source Text Module Records

2.1.1.2.1ParseModule ( sourceText, realm, hostDefined )

The abstract operation ParseModule with arguments sourceText, realm, and hostDefined creates a Source Text Module Record based upon the result of parsing sourceText as a Module. ParseModule performs the following steps:

  1. Assert: sourceText is an ECMAScript source text (see clause 10).
  2. Parse sourceText using Module as the goal symbol and analyse the parse result for any Early Error conditions. If the parse was successful and no early errors were found, let body be the resulting parse tree. Otherwise, let body be a List of one or more SyntaxError or ReferenceError objects representing the parsing errors and/or early errors. Parsing and early error detection may be interweaved in an implementation-dependent manner. If more than one parsing error or early error is present, the number and ordering of error objects in the list is implementation-dependent, but at least one must be present.
  3. If body is a List of errors, return body.
  4. Let requestedModules be the ModuleRequests of body.
  5. Let importEntries be ImportEntries of body.
  6. Let importedBoundNames be ImportedLocalNames(importEntries).
  7. Let indirectExportEntries be a new empty List.
  8. Let localExportEntries be a new empty List.
  9. Let starExportEntries be a new empty List.
  10. Let exportEntries be ExportEntries of body.
  11. For each ExportEntry Record ee in exportEntries, do
    1. If ee.[[ModuleRequest]] is null, then
      1. If ee.[[LocalName]] is not an element of importedBoundNames, then
        1. Append ee to localExportEntries.
      2. Else,
        1. Let ie be the element of importEntries whose [[LocalName]] is the same as ee.[[LocalName]].
        2. If ie.[[ImportName]] is "*", then
          1. Assert: This is a re-export of an imported module namespace object.
          2. Append ee to localExportEntries.
        3. Else 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.
    2. Else if ee.[[ImportName]] is "*" and ee.[[ExportName]] is null, then
      1. Append ee to starExportEntries.
    3. Else,
      1. Append ee to indirectExportEntries.
  12. Return Source Text Module Record {[[Realm]]: realm, [[Environment]]: undefined, [[Namespace]]: undefined, [[Status]]: "uninstantiated", [[EvaluationError]]: undefined, [[HostDefined]]: hostDefined, [[ECMAScriptCode]]: body, [[RequestedModules]]: requestedModules, [[ImportEntries]]: importEntries, [[LocalExportEntries]]: localExportEntries, [[IndirectExportEntries]]: indirectExportEntries, [[StarExportEntries]]: starExportEntries, [[DFSIndex]]: undefined, [[DFSAncestorIndex]]: undefined}.
Note

An implementation may parse module source text and analyse it for Early Error conditions prior to the evaluation of ParseModule for that module source text. However, the reporting of any errors must be deferred until the point where this specification actually performs ParseModule upon that source text.

2.1.1.2.2ResolveExport( 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.

This abstract method performs the following steps:

  1. Let module be this Source Text Module Record.
  2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do
    1. If module and r.[[Module]] are the same Module Record and SameValue(exportName, r.[[ExportName]]) is true, then
      1. Assert: This is a circular import request.
      2. Return null.
  3. Append the Record {[[Module]]: module, [[ExportName]]: exportName} to resolveSet.
  4. For each ExportEntry Record e in module.[[LocalExportEntries]], do
    1. If SameValue(exportName, e.[[ExportName]]) is true, then
      1. Assert: module provides the direct binding for this export.
      2. Return ResolvedBinding Record {[[Module]]: module, [[BindingName]]: e.[[LocalName]]}.
  5. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
    1. If SameValue(exportName, e.[[ExportName]]) is true, then
      1. If e.[[ImportName]] is "*", then
        1. NOTE: module does not provide the direct binding for this export.
        2. Return ResolvedBinding Record {[[Module]]: e.[[ModuleRequest]], [[BindingName]]: "*namespace*"}.
      2. Else,
        1. Assert: module imports a specific binding for this export.
        2. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]).
        3. Return importedModule.ResolveExport(e.[[ImportName]], resolveSet)
      3. Assert: module imports a specific binding for this export.
      4. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]).
      5. Return importedModule.ResolveExport(e.[[ImportName]], resolveSet).
  6. If SameValue(exportName, "default") is true, then
    1. Assert: A default export was not explicitly defined by this module.
    2. Return null.
    3. NOTE: A default export cannot be provided by an export *.
  7. Let starResolution be null.
  8. For each ExportEntry Record e in module.[[StarExportEntries]], do
    1. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]).
    2. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet).
    3. If resolution is "ambiguous", return "ambiguous".
    4. If resolution is not null, then
      1. Assert: resolution is a ResolvedBinding Record.
      2. If starResolution is null, set starResolution to resolution.
      3. Else,
        1. Assert: There is more than one * import that includes the requested name.
        2. If resolution.[[Module]] and starResolution.[[Module]] are not the same Module Record or SameValue(resolution.[[BindingName]], starResolution.[[BindingName]]) is false, return "ambiguous".
  9. Return starResolution.

2.1.1.2.3Instantiate( ) Concrete Method

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

On success, Instantiate transitions this module's [[Status]] from "uninstantiated" to "instantiated". On failure, an exception is thrown and this module's [[Status]] remains "uninstantiated".

This abstract method performs the following steps (most of the work is done by the auxiliary function InnerModuleInstantiation):

  1. Let module be this Source Text Module Record.
  2. Assert: module.[[Status]] is not "instantiating" or "evaluating".
  3. Let stack be a new empty List.
  4. Let result be InnerModuleInstantiation(module, stack, 0).
  5. If result is an abrupt completion, then
    1. For each module m in stack, do
      1. Assert: m.[[Status]] is "instantiating".
      2. Set m.[[Status]] to "uninstantiated".
      3. Set m.[[Environment]] to undefined.
      4. Set m.[[DFSIndex]] to undefined.
      5. Set m.[[DFSAncestorIndex]] to undefined.
    2. Assert: module.[[Status]] is "uninstantiated".
    3. Return result.
  6. Assert: module.[[Status]] is "instantiated" or "evaluated".
  7. Assert: stack is empty.
  8. Return undefined.

2.1.1.2.3.1ModuleDeclarationEnvironmentSetup( module )

The ModuleDeclarationEnvironmentSetup abstract operation is used by InnerModuleInstantiation to initialize the Lexical Environment of the module, including resolving all imported bindings.

This abstract operation performs the following steps:

  1. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
    1. Let resolution be ? module.ResolveExport(e.[[ExportName]], « »).
    2. If resolution is null or "ambiguous", throw a SyntaxError exception.
    3. Assert: resolution is a ResolvedBinding Record.
  2. Assert: All named exports from module are resolvable.
  3. Let realm be module.[[Realm]].
  4. Assert: realm is not undefined.
  5. Let env be NewModuleEnvironment(realm.[[GlobalEnv]]).
  6. Set module.[[Environment]] to env.
  7. Let envRec be env's EnvironmentRecord.
  8. For each ImportEntry Record in in module.[[ImportEntries]], do
    1. Let importedModule be ! HostResolveImportedModule(module, in.[[ModuleRequest]]).
    2. 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.
    3. If in.[[ImportName]] is "*", then
      1. Let namespace be ? GetModuleNamespace(importedModule).
      2. Perform ! envRec.CreateImmutableBinding(in.[[LocalName]], true).
      3. Call envRec.InitializeBinding(in.[[LocalName]], namespace).
    4. Else,
      1. Let resolution be ? importedModule.ResolveExport(in.[[ImportName]], « »).
      2. If resolution is null or "ambiguous", throw a SyntaxError exception.
      3. If resolution.[[BindingName]] is "*namespace*", then
        1. Let namespace be ? GetModuleNamespace(resolution.[[Module]]).
        2. Perform ! envRec.CreateImmutableBinding(in.[[LocalName]], true).
        3. Call envRec.InitializeBinding(in.[[LocalName]], namespace).
      4. Else,
        1. Call envRec.CreateImportBinding(in.[[LocalName]], resolution.[[Module]], resolution.[[BindingName]]).
      5. Call envRec.CreateImportBinding(in.[[LocalName]], resolution.[[Module]], resolution.[[BindingName]]).
  9. Let code be module.[[ECMAScriptCode]].
  10. Let varDeclarations be the VarScopedDeclarations of code.
  11. Let declaredVarNames be a new empty List.
  12. For each element d in varDeclarations, do
    1. For each element dn of the BoundNames of d, do
      1. If dn is not an element of declaredVarNames, then
        1. Perform ! envRec.CreateMutableBinding(dn, false).
        2. Call envRec.InitializeBinding(dn, undefined).
        3. Append dn to declaredVarNames.
  13. Let lexDeclarations be the LexicallyScopedDeclarations of code.
  14. For each element d in lexDeclarations, do
    1. For each element dn of the BoundNames of d, do
      1. If IsConstantDeclaration of d is true, then
        1. Perform ! envRec.CreateImmutableBinding(dn, true).
      2. Else,
        1. Perform ! envRec.CreateMutableBinding(dn, false).
      3. If d is a FunctionDeclaration, a GeneratorDeclaration, an AsyncFunctionDeclaration, or an AsyncGeneratorDeclaration, then
        1. Let fo be the result of performing InstantiateFunctionObject for d with argument env.
        2. Call envRec.InitializeBinding(dn, fo).

2.1.2Exports

Syntax

ExportDeclaration:exportVariableStatement exportDeclaration exportdefaultHoistableDeclaration[Default] exportdefaultClassDeclaration[Default] exportdefault[lookahead ∉ { function, class }]AssignmentExpression[In]; ExportDeclaration:export*FromClause; exportExportClauseFromClause; exportExportClause; ExportDeclaration:exportExportFromClauseFromClause; exportNamedExports; ExportFromClause:* NamedExports NameSpaceExport NameSpaceExport:*asIdentifierName ExportClause:{} {ExportsList} {ExportsList,} NamedExports:{} {ExportsList} {ExportsList,} Note
Renaming ExportClause to NamedExports reflects the similarly named NamedImports, and should be reflected throughout the spec.
ExportsList:ExportSpecifier ExportsList,ExportSpecifier ExportSpecifier:IdentifierName IdentifierNameasIdentifierName

2.1.2.1Static Semantics: BoundNames

ExportDeclaration:export*FromClause; exportExportClauseFromClause; exportExportClause; ExportDeclaration:exportExportFromClauseFromClause; exportNamedExports;
  1. Return a new empty List.

2.1.2.2Static Semantics: ExportedBindings

ExportDeclaration:exportExportClauseFromClause; export*FromClause; ExportDeclaration:exportExportFromClauseFromClause;
  1. Return a new empty List.

2.1.2.3Static Semantics: ExportedNames

ExportDeclaration:export*FromClause;
  1. Return a new empty List.
ExportDeclaration:exportExportClauseFromClause; exportExportClause;
  1. Return the ExportedNames of ExportClause.
ExportDeclaration:exportExportFromClauseFromClause;
  1. Return the ExportedNames of ExportFromClause.
ExportFromClause:*
  1. Return a new empty List.
ExportFromClause:NamedExports
  1. Return the ExportedNames of NamedExports.
NameSpaceExport:*asIdentifierName
  1. Return a List containing the StringValue of IdentifierName.

2.1.2.4Static Semantics: ExportEntries

ExportDeclaration:export*FromClause;
  1. Let module be the sole element of ModuleRequests of FromClause.
  2. Let entry be the Record {[[ModuleRequest]]: module, [[ImportName]]: "*", [[LocalName]]: null, [[ExportName]]: null }.
  3. Return a new List containing entry.
ExportDeclaration:exportExportClauseFromClause;
  1. Let module be the sole element of ModuleRequests of FromClause.
  2. Return ExportEntriesForModule of ExportClause with argument module.
ExportDeclaration:exportExportFromClauseFromClause;
  1. Let module be the sole element of ModuleRequests of FromClause.
  2. Return ExportEntriesForModule of ExportFromClause with argument module.

2.1.2.5Static Semantics: ExportEntriesForModule

With parameter module.

ExportFromClause:*
  1. Return a new List containing the Record {[[ModuleRequest]]: module, [[ImportName]]: "*", [[LocalName]]: null, [[ExportName]]: null }.
NameSpaceExport:*asIdentifierName
  1. Let exportName be the StringValue of IdentifierName.
  2. Return a new List containing the Record {[[ModuleRequest]]: module, [[ImportName]]: "*", [[LocalName]]: null, [[ExportName]]: _exportName_ }.

2.1.2.6Static Semantics: IsConstantDeclaration

ExportDeclaration:export*FromClause; exportExportClauseFromClause; exportExportClause; exportdefaultAssignmentExpression; ExportDeclaration:exportExportFromClauseFromClause; exportNamedExports; exportdefaultAssignmentExpression;
  1. Return false.

2.1.2.7Static Semantics: LexicallyScopedDeclarations

ExportDeclaration:export*FromClause; exportExportClauseFromClause; exportExportClause; exportVariableStatement ExportDeclaration:exportExportFromClauseFromClause; exportNamedExports; exportVariableStatement
  1. Return a new empty List.

2.1.2.8Static Semantics: ModuleRequests

ExportDeclaration:export*FromClause; ExportDeclaration:exportExportClauseFromClause; ExportDeclaration:exportExportFromClauseFromClause;
  1. Return the ModuleRequests of FromClause.

2.1.2.9Runtime Semantics: Evaluation

ExportDeclaration:export*FromClause; exportExportClauseFromClause; exportExportClause; ExportDeclaration:exportExportFromClauseFromClause; exportNamedExports;
  1. Return NormalCompletion(empty).

3Module Namespace Objects

A Module Namespace Object is a module namespace exotic object that provides runtime property-based access to a module's exported bindings. There is no constructor function for Module Namespace Objects. Instead, such an object is created for each module that is imported by an ImportDeclaration that includes a NameSpaceImport or exported by a NameSpaceExport.

In addition to the properties specified in 1 each Module Namespace Object has the following own property:

3.1@@toStringTag

The initial value of the @@toStringTag property is the String value "Module".

This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.