Skip to content

Commit

Permalink
fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed May 16, 2024
1 parent 09313ba commit a608f3b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,13 @@ Returns a list of the explicit named exports of the module of the form `String[]
### `AbstractModuleSource.prototype.starExports()`
Returns a list of the imports which are star exported, of the form `Import[]`.
Returns a list of the imports which are star exported, of the form `InstanceImport` defined by:
```ts
interface InstanceImport {
specifier: string
}
```
### `AbstractModuleSource.prototype.hasDynamicImport`
Expand Down
4 changes: 2 additions & 2 deletions build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3999,7 +3999,7 @@ <h1><span class="secnum">16.1.1.4</span> <del>HostGetModuleSourceName ( <var>mod
For any object that is a <emu-xref href="#sec-module-source-objects" id="_ref_36"><a href="#sec-module-source-objects">Module Source Object</a></emu-xref>, returns a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion</a></emu-xref> for a String corresponding to the source record type to be used as the strongly branded return value of the <emu-xref href="#sec-well-known-symbols"><a href="https://tc39.es/ecma262/#sec-well-known-symbols">@@toStringTag</a></emu-xref> getter on %AbstractModuleSource%.
</li>
<li>
For any object which is not a <emu-xref href="#sec-module-source-objects" id="_ref_37"><a href="#sec-module-source-objects">Module Source Object</a></emu-xref><ins>, or was not originally obtained through GetModuleSource</ins>, returns a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">throw completion</a></emu-xref>.
For any object which is not a <emu-xref href="#sec-module-source-objects" id="_ref_37"><a href="#sec-module-source-objects">Module Source Object</a></emu-xref>, returns a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">throw completion</a></emu-xref>.
</li>
</ul>
</emu-clause>
Expand Down Expand Up @@ -4118,7 +4118,7 @@ <h1><span class="secnum">28.1.3.4</span> <ins>%AbstractModuleSource%.prototype.n
<emu-clause id="sec-%abstractmodulesource%.prototype.starExports">
<h1><span class="secnum">28.1.3.5</span> <ins>%AbstractModuleSource%.prototype.starExports ( )</ins></h1>
<p>This method performs the following steps when called:</p>
<emu-alg><ol><li>Let <var>M</var> be the <emu-val>this</emu-val> value.</li><li>Let <var>module</var> be ?&nbsp;<emu-xref aoid="HostGetModuleRecordFromSource" id="_ref_57"><a href="#sec-HostGetModuleRecordFromSource">HostGetModuleRecordFromSource</a></emu-xref>(<var>M</var>).</li><li>If <var>module</var> is <emu-const>not-a-source</emu-const>, throw a <emu-val>TypeError</emu-val> exception.</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>module</var> is a <emu-xref href="#cyclic-module-record" id="_ref_58"><a href="#cyclic-module-record">Cyclic Module Record</a></emu-xref>.</li><li>Let <var>starExports</var> be a new empty <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>Let <var>starExportRequests</var> be !&nbsp;<var>module</var>.GetStarExports().</li><li>For each ModuleRequest <var>request</var> in <var>starExportRequests</var>, do<ol><li>Let <var>starExport</var> be <emu-xref aoid="OrdinaryObjectCreate"><a href="https://tc39.es/ecma262/#sec-ordinaryobjectcreate">OrdinaryObjectCreate</a></emu-xref>(<emu-val>null</emu-val>).</li><li>Perform !&nbsp;<emu-xref aoid="CreateDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>starExport</var>, <emu-val>"specifier"</emu-val>, <var>request</var>.<var class="field">[[Specifier]]</var>).</li><li>Let <var>phase</var> be <var>request</var>.<var class="field">[[Phase]]</var>.</li><li>Let <var>maybePhaseString</var> be <emu-val>null</emu-val>.</li><li>If <var>phase</var> is <emu-const>source</emu-const>, then<ol><li>Set <var>maybePhaseString</var> to <emu-val>"source"</emu-val>.</li></ol></li><li>Perform !&nbsp;<emu-xref aoid="CreateDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>starExport</var>, <emu-val>"phase"</emu-val>, <var>maybePhaseString</var>).</li><li>Append <var>starExport</var> to <var>starExports</var>.</li></ol></li><li>Return <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(<var>starExports</var>).</li></ol></emu-alg>
<emu-alg><ol><li>Let <var>M</var> be the <emu-val>this</emu-val> value.</li><li>Let <var>module</var> be ?&nbsp;<emu-xref aoid="HostGetModuleRecordFromSource" id="_ref_57"><a href="#sec-HostGetModuleRecordFromSource">HostGetModuleRecordFromSource</a></emu-xref>(<var>M</var>).</li><li>If <var>module</var> is <emu-const>not-a-source</emu-const>, throw a <emu-val>TypeError</emu-val> exception.</li><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>module</var> is a <emu-xref href="#cyclic-module-record" id="_ref_58"><a href="#cyclic-module-record">Cyclic Module Record</a></emu-xref>.</li><li>Let <var>starExports</var> be a new empty <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>Let <var>starExportRequests</var> be !&nbsp;<var>module</var>.GetStarExports().</li><li>For each ModuleRequest <var>request</var> in <var>starExportRequests</var>, do<ol><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>request</var>.<var class="field">[[Phase]]</var> is <emu-const>instance</emu-const>.</li><li>Let <var>starExport</var> be <emu-xref aoid="OrdinaryObjectCreate"><a href="https://tc39.es/ecma262/#sec-ordinaryobjectcreate">OrdinaryObjectCreate</a></emu-xref>(<emu-val>null</emu-val>).</li><li>Perform !&nbsp;<emu-xref aoid="CreateDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>starExport</var>, <emu-val>"specifier"</emu-val>, <var>request</var>.<var class="field">[[Specifier]]</var>).</li><li>Append <var>starExport</var> to <var>starExports</var>.</li></ol></li><li>Return <emu-xref aoid="CreateArrayFromList"><a href="https://tc39.es/ecma262/#sec-createarrayfromlist">CreateArrayFromList</a></emu-xref>(<var>starExports</var>).</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-%abstractmodulesource%.prototype.hasDynamicImport">
Expand Down
8 changes: 2 additions & 6 deletions spec.emu
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ contributors: Luca Casonato, Guy Bedford
For any object that is a Module Source Object, returns a normal completion for a String corresponding to the source record type to be used as the strongly branded return value of the @@toStringTag getter on %AbstractModuleSource%.
</li>
<li>
For any object which is not a Module Source Object<ins>, or was not originally obtained through GetModuleSource</ins>, returns a throw completion.
For any object which is not a Module Source Object, returns a throw completion.
</li>
</ul>
</emu-clause>
Expand Down Expand Up @@ -1659,13 +1659,9 @@ contributors: Luca Casonato, Guy Bedford
1. Let _starExports_ be a new empty List.
1. Let _starExportRequests_ be ! _module_.GetStarExports().
1. For each ModuleRequest _request_ in _starExportRequests_, do
1. Assert: _request_.[[Phase]] is ~instance~.
1. Let _starExport_ be OrdinaryObjectCreate(*null*).
1. Perform ! CreateDataPropertyOrThrow(_starExport_, *"specifier"*, _request_.[[Specifier]]).
1. Let _phase_ be _request_.[[Phase]].
1. Let _maybePhaseString_ be *null*.
1. If _phase_ is ~source~, then
1. Set _maybePhaseString_ to *"source"*.
1. Perform ! CreateDataPropertyOrThrow(_starExport_, *"phase"*, _maybePhaseString_).
1. Append _starExport_ to _starExports_.
1. Return CreateArrayFromList(_starExports_).
</emu-alg>
Expand Down

0 comments on commit a608f3b

Please sign in to comment.