Skip to content

Commit

Permalink
Editorial: more assertions for module AOs (tc39#3165)
Browse files Browse the repository at this point in the history
This makes clear arguments passed to ResolveExport and GetImportedModule is not null.
  • Loading branch information
doehyunbaek authored and ljharb committed Nov 1, 2023
1 parent e27d5fa commit ea5ee21
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -27895,6 +27895,7 @@ <h1>
1. Assert: _e_.[[ExportName]] is not *null*.
1. Append _e_.[[ExportName]] to _exportedNames_.
1. For each ExportEntry Record _e_ of _module_.[[StarExportEntries]], do
1. Assert: _e_.[[ModuleRequest]] is not *null*.
1. Let _requestedModule_ be GetImportedModule(_module_, _e_.[[ModuleRequest]]).
1. Let _starNames_ be _requestedModule_.GetExportedNames(_exportStarSet_).
1. For each element _n_ of _starNames_, do
Expand Down Expand Up @@ -27940,6 +27941,7 @@ <h1>
1. Return ResolvedBinding Record { [[Module]]: _module_, [[BindingName]]: _e_.[[LocalName]] }.
1. For each ExportEntry Record _e_ of _module_.[[IndirectExportEntries]], do
1. If SameValue(_exportName_, _e_.[[ExportName]]) is *true*, then
1. Assert: _e_.[[ModuleRequest]] is not *null*.
1. Let _importedModule_ be GetImportedModule(_module_, _e_.[[ModuleRequest]]).
1. If _e_.[[ImportName]] is ~all~, then
1. Assert: _module_ does not provide the direct binding for this export.
Expand All @@ -27953,6 +27955,7 @@ <h1>
1. NOTE: A `default` export cannot be provided by an `export * from "mod"` declaration.
1. Let _starResolution_ be *null*.
1. For each ExportEntry Record _e_ of _module_.[[StarExportEntries]], do
1. Assert: _e_.[[ModuleRequest]] is not *null*.
1. Let _importedModule_ be GetImportedModule(_module_, _e_.[[ModuleRequest]]).
1. Let _resolution_ be _importedModule_.ResolveExport(_exportName_, _resolveSet_).
1. If _resolution_ is ~ambiguous~, return ~ambiguous~.
Expand All @@ -27978,6 +27981,7 @@ <h1>InitializeEnvironment ( ): either a normal completion containing ~unused~ or

<emu-alg>
1. For each ExportEntry Record _e_ of _module_.[[IndirectExportEntries]], do
1. Assert: _e_.[[ExportName]] is not *null*.
1. Let _resolution_ be _module_.ResolveExport(_e_.[[ExportName]]).
1. If _resolution_ is either *null* or ~ambiguous~, throw a *SyntaxError* exception.
1. Assert: _resolution_ is a ResolvedBinding Record.
Expand Down

0 comments on commit ea5ee21

Please sign in to comment.