From d99bdbde60b380355fcdc0f6ed8f7c05674ea91d Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Mon, 10 Sep 2018 17:05:24 +0200 Subject: [PATCH] Normative: GetExportedNames adjustments for late-defined export names This provides two features needed for supporting late-defined export names on custom module records. Firstly, a second argument to GetExportedNames of the namespace module being constructed by this call, allowing it to be tracked, and secondly permitting ResolveExport and GetExportedNames operations to provide abrupt completions corresponding to instantiation errors. --- spec.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec.html b/spec.html index ff8c3a9456..7456aa24a5 100644 --- a/spec.html +++ b/spec.html @@ -21415,7 +21415,7 @@

Abstract Module Records

- GetExportedNames(_exportStarSet_) + GetExportedNames(_exportStarSet_, _nsModule_) Return a list of all names that are either directly or indirectly exported from this module. @@ -22007,7 +22007,7 @@

ParseModule ( _sourceText_, _realm_, _hostDefined_ )

-

GetExportedNames ( _exportStarSet_ ) Concrete Method

+

GetExportedNames ( _exportStarSet_, _nsModule_ ) Concrete Method

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

It performs the following steps:

@@ -22025,7 +22025,7 @@

GetExportedNames ( _exportStarSet_ ) Concrete Method

1. Append _e_.[[ExportName]] to _exportedNames_. 1. For each ExportEntry Record _e_ in _module_.[[StarExportEntries]], do 1. Let _requestedModule_ be ? HostResolveImportedModule(_module_, _e_.[[ModuleRequest]]). - 1. Let _starNames_ be ? _requestedModule_.GetExportedNames(_exportStarSet_). + 1. Let _starNames_ be ? _requestedModule_.GetExportedNames(_exportStarSet_, _nsModule_). 1. For each element _n_ of _starNames_, do 1. If SameValue(_n_, `"default"`) is *false*, then 1. If _n_ is not an element of _exportedNames_, then @@ -22382,7 +22382,7 @@

Runtime Semantics: GetModuleNamespace ( _module_ )

1. Return _namespace_.
-

The only way GetModuleNamespace can throw is via one of the triggered HostResolveImportedModule calls. Unresolvable names are simply excluded from the namespace at this point. They will lead to a real instantiation error later unless they are all ambiguous star exports that are not explicitly requested anywhere.

+

The only ways GetModuleNamespace can throw is either via one of the triggered HostResolveImportedModule calls or if GetExportedNames throws for a specific module record implementation. Unresolvable names are simply excluded from the namespace at this point. They will lead to a real instantiation error later unless they are all ambiguous star exports that are not explicitly requested anywhere.