Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: Narrow return type of GetExportedNames and more assertions #3165

Merged
merged 2 commits into from
Nov 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -27872,7 +27872,7 @@ <h1>
<h1>
GetExportedNames (
optional _exportStarSet_: a List of Source Text Module Records,
): a List of either Strings or *null*
): a List of Strings
</h1>
<dl class="header">
<dt>for</dt>
Expand All @@ -27888,11 +27888,14 @@ <h1>
1. Let _exportedNames_ be a new empty List.
1. For each ExportEntry Record _e_ of _module_.[[LocalExportEntries]], do
1. Assert: _module_ provides the direct binding for this export.
1. Assert: _e_.[[ExportName]] is not *null*.
1. Append _e_.[[ExportName]] to _exportedNames_.
1. For each ExportEntry Record _e_ of _module_.[[IndirectExportEntries]], do
1. Assert: _module_ imports a specific binding for this export.
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 @@ -27938,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 @@ -27951,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 @@ -27976,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