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

suggested changes #1

Closed
wants to merge 16 commits into from
Closed
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
171 changes: 88 additions & 83 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -3232,6 +3232,16 @@ <h1>Well-Known Intrinsic Objects</h1>
ECMAScript Language Association
</th>
</tr>
<tr>
<td>
%AbstractModuleSource%
</td>
<td>
</td>
<td>
The %AbstractModuleSource% constructor (<emu-xref href="#sec-%abstractmodulesource%-constructor"></emu-xref>)
</td>
</tr>
<tr>
<td>
%AggregateError%
Expand Down Expand Up @@ -19320,23 +19330,24 @@ <h1>Runtime Semantics: Evaluation</h1>
1. Return ? EvaluateImportCall(|AssignmentExpression|, ~evaluation~).
</emu-alg>

<emu-grammar>ImportCall : `import` `.` `source` `(` AssignmentExpression[+In, ?Yield, ?Await] `)`</emu-grammar>
<emu-grammar>ImportCall : `import` `.` `source` `(` AssignmentExpression `)`</emu-grammar>
<emu-alg>
1. Return ? EvaluateImportCall(|AssignmentExpression|, ~source~).
</emu-alg>

<emu-clause id="sec-evaluate-import-call" type="abstract operation">
<h1>
EvaluateImportCall (
_specifierExpression_: a ParseNode,
_phase_: ~source~ or ~evaluation~
_specifierExpression_: a Parse Node,
_phase_: ~source~ or ~evaluation~,
): either a normal completion containing a Promise or a throw completion
</h1>
<dl class="header"></dl>
<dl class="header">
</dl>
<emu-alg>
1. Let _referrer_ be GetActiveScriptOrModule().
1. If _referrer_ is *null*, set _referrer_ to the current Realm Record.
1. Let _specifierRef_ be the result of evaluating _specifierExpression_.
1. Let _specifierRef_ be ? Evaluation of _specifierExpression_.
1. Let _specifier_ be ? GetValue(_specifierRef_).
1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%).
1. Let _specifierString_ be Completion(ToString(_specifier_)).
Expand Down Expand Up @@ -19367,9 +19378,9 @@ <h1>
1. If _phase_ is ~source~, then
1. Let _moduleSourceCompletion_ be Completion(_module_.GetModuleSource()).
1. If _moduleSourceCompletion_ is an abrupt completion, then
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, &laquo; _moduleSourceCompletion_.[[Value]] &raquo;).
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _moduleSourceCompletion_.[[Value]] »).
1. Else,
1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, &laquo; _moduleSourceCompletion_.[[Value]] &raquo;).
1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _moduleSourceCompletion_.[[Value]] »).
1. Return ~unused~.
1. Let _loadPromise_ be _module_.LoadRequestedModules().
1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that captures _promiseCapability_ and performs the following steps when called:
Expand Down Expand Up @@ -25926,43 +25937,41 @@ <h1>
<emu-clause id="sec-modulerequest-record">
<h1>ModuleRequest Records</h1>
<p>A <dfn id="modulerequest-record" variants="ModuleRequest Records">ModuleRequest Record</dfn> represents the request to import a module up to a given phase. It consists of the following fields:</p>
<emu-table id="table-modulerequest-record-fields" caption="ModuleRequest Record fields">
<emu-table id="table-modulerequest-record-fields" caption="ModuleRequest Record Fields">
<table>
<tbody>
<tr>
<th>
Field Name
</th>
<th>
Value Type
</th>
<th>
Meaning
</th>
</tr>
<tr>
<td>
[[Specifier]]
</td>
<td>
String
</td>
<td>
The module specifier
</td>
</tr>
<tr>
<td>
[[Phase]]
</td>
<td>
~source~ or ~evaluation~
</td>
<td>
The target import phase
</td>
</tr>
</tbody>
<tr>
<th>
Field Name
</th>
<th>
Value Type
</th>
<th>
Meaning
</th>
</tr>
<tr>
<td>
[[Specifier]]
</td>
<td>
a String
</td>
<td>
The module specifier
</td>
</tr>
<tr>
<td>
[[Phase]]
</td>
<td>
~source~ or ~evaluation~
</td>
<td>
The target import phase
</td>
</tr>
</table>
</emu-table>

Expand All @@ -25988,7 +25997,7 @@ <h1>Static Semantics: ModuleRequests ( ): a List of ModuleRequest Records</h1>
1. For each ModuleRequest Record _mr_ of _additionalRequests_, do
1. Let _found_ be *false*.
1. For each ModuleRequest Record _mr2_ of _requests_, do
1. If _mr_.[[Specifer]] is _mr2_.[[Specifer]] and _mr_.[[Phase]] is _mr2_.[[Phase]], then
1. If _mr_.[[Specifier]] is _mr2_.[[Specifier]] and _mr_.[[Phase]] is _mr2_.[[Phase]], then
1. Assert: _found_ is *false*.
1. Set _found_ to *true*.
1. If _found_ is *false*, then
Expand All @@ -26002,19 +26011,19 @@ <h1>Static Semantics: ModuleRequests ( ): a List of ModuleRequest Records</h1>
<emu-grammar>ImportDeclaration : `import` ImportClause FromClause `;`</emu-grammar>
<emu-alg>
1. Let _specifier_ be SV of |FromClause|.
1. Return a List whose sole element is the ModuleRequest Record { [[Specifer]]: _specifier_, [[Phase]]: ~evaluation~ }.
1. Return a List whose sole element is the ModuleRequest Record { [[Specifier]]: _specifier_, [[Phase]]: ~evaluation~ }.
</emu-alg>
<emu-grammar>ImportDeclaration : `import` `source` ImportedBinding FromClause `;`</emu-grammar>
<emu-alg>
1. Let _specifier_ be SV of |FromClause|.
1. Return a List whose sole element is the ModuleRequest Record { [[Specifer]]: _specifier_, [[Phase]]: ~source~ }.
1. Return a List whose sole element is the ModuleRequest Record { [[Specifier]]: _specifier_, [[Phase]]: ~source~ }.
</emu-alg>
<emu-grammar>
ExportDeclaration : `export` ExportFromClause FromClause `;`
</emu-grammar>
<emu-alg>
1. Let _specifier_ be SV of |FromClause|.
1. Return a List whose sole element is the ModuleRequest Record { [[Specifer]]: _specifier_, [[Phase]]: ~evaluation~ }.
1. Return a List whose sole element is the ModuleRequest Record { [[Specifier]]: _specifier_, [[Phase]]: ~evaluation~ }.
</emu-alg>
<emu-grammar>
ExportDeclaration :
Expand All @@ -26034,32 +26043,30 @@ <h1>Static Semantics: ModuleRequests ( ): a List of ModuleRequest Records</h1>
<h1>ModuleSource Records</h1>

<p>A <dfn id="modulesource-record" variants="ModuleSource Records">ModuleSource Record</dfn> represents the request to import a module up to a given phase. It consists of the following fields:</p>
<emu-table id="table-modulesource-record-fields" caption="ModuleSource Record fields">
<emu-table id="table-modulesource-record-fields" caption="ModuleSource Record Fields">
<table>
<tbody>
<tr>
<th>
Field Name
</th>
<th>
Value Type
</th>
<th>
Meaning
</th>
</tr>
<tr>
<td>
[[SourceClassName]]
</td>
<td>
String
</td>
<td>
The unique source class name string used to represent this module source. Source Text Module Records are usually represented by the *"ModuleSource"* class.
</td>
</tr>
</tbody>
<tr>
<th>
Field Name
</th>
<th>
Value Type
</th>
<th>
Meaning
</th>
</tr>
<tr>
<td>
[[SourceClassName]]
</td>
<td>
a String
</td>
<td>
The unique source class name string used to represent this module source. Source Text Module Records are usually represented by the *"ModuleSource"* class.
</td>
</tr>
</table>
</emu-table>
</emu-clause>
Expand Down Expand Up @@ -26145,10 +26152,10 @@ <h1>Abstract Module Records</h1>
GetModuleSource()
</td>
<td>
<p>It returns either a normal completion completion for the ModuleSource Object corresponding to this source Module Record's source phase (<emu-xref href="#sec-module-source-objects"></emu-xref>), or a throw completion.</p>
<p>It returns either a normal completion containing the ModuleSource Object corresponding to this source Module Record's source phase (<emu-xref href="#sec-module-source-objects"></emu-xref>), or a throw completion.</p>
<p>When called multiple times on the same Module Record, if GetModuleSource() returns a normal completion it must always return a normal completion containing the same object.</p>
<p>The returned object should be an instance of a subclass of %AbstractModuleSource%, and it must have an internal slot [[ModuleSourceRecord]].</p>
<p>Module Record's that do not have a source represemtation must always return a throw completion containing a *ReferenceError*.</p>
<p>Module Records that do not have a source represemtation must always return a throw completion containing a *ReferenceError*.</p>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -26485,7 +26492,7 @@ <h1>
InnerModuleLoading (
_state_: a GraphLoadingState Record,
_module_: a Module Record,
_loadRecursively_: a Boolean
_loadRecursively_: a Boolean,
): ~unused~
</h1>
<dl class="header">
Expand All @@ -26503,7 +26510,7 @@ <h1>
1. If _module_.[[LoadedModules]] contains a Record whose [[Specifier]] is _required_.[[Specifier]], then
1. Let _record_ be that Record.
1. Let _innerLoadRecursively_ be *true*.
1. If _required_.[[Phase]] is ~source~ set _innerLoadRecursively_ to *false*.
1. If _required_.[[Phase]] is ~source~, set _innerLoadRecursively_ to *false*.
1. Perform InnerModuleLoading(_state_, _record_.[[Module]], _innerLoadRecursively_).
1. Else,
1. Perform HostLoadImportedModule(_module_, _required_, _state_.[[HostDefined]], _state_).
Expand Down Expand Up @@ -26537,7 +26544,7 @@ <h1>
1. If _state_.[[IsLoading]] is *false*, return ~unused~.
1. If _moduleCompletion_ is a normal completion, then
1. Let _loadRecursively_ be *true*.
1. If _phase_ is ~source~ set _loadRecursively_ to *false*.
1. If _phase_ is ~source~, set _loadRecursively_ to *false*.
1. Perform InnerModuleLoading(_state_, _moduleCompletion_.[[Value]], _loadRecursively_).
1. Else,
1. Set _state_.[[IsLoading]] to *false*.
Expand Down Expand Up @@ -26693,7 +26700,7 @@ <h1>
1. Append _module_ to _stack_.
1. For each ModuleRequest Record _required_ of _module_.[[RequestedModules]], do
1. Let _requiredModule_ be GetImportedModule(_module_, _required_.[[Specifier]]).
1. If _requiredModule_.[[Phase]] is ~evaluation~, then
1. If _required_.[[Phase]] is ~evaluation~, then
1. Set _index_ to ? InnerModuleEvaluation(_requiredModule_, _stack_, _index_).
1. If _requiredModule_ is a Cyclic Module Record, then
1. Assert: _requiredModule_.[[Status]] is one of ~evaluating~, ~evaluating-async~, or ~evaluated~.
Expand Down Expand Up @@ -27396,7 +27403,7 @@ <h1>Source Text Module Records</h1>
[[ImportName]]
</td>
<td>
a String or ~namespace-object~
a String, ~source~, or ~namespace-object~
</td>
<td>
The name under which the desired binding is exported by the module identified by [[ModuleRequest]]. The value ~namespace-object~ indicates that the import request is for the target module's namespace object.
Expand Down Expand Up @@ -27804,9 +27811,7 @@ <h1>
</emu-clause>

<emu-clause id="sec-getmodulesource" type="concrete method">
<h1>
GetModuleSource ( ): either a normal completion containing an Object or a throw completion
</h1>
<h1>GetModuleSource ( ): either a normal completion containing an Object or a throw completion</h1>
<dl class="header">
<dt>for</dt>
<dd>a Source Text Module Record _module_</dd>
Expand Down Expand Up @@ -46959,7 +46964,7 @@ <h1>%AbstractModuleSource%.prototype.constructor</h1>

<emu-clause id="sec-get-%abstractmodulesource%.prototype.@@tostringtag">
<h1>get %AbstractModuleSource%.prototype [ @@toStringTag ]</h1>
<p>%AbstractModuleSource%.prototype `[@@toStringTag]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:</p>
<p>%AbstractModuleSource%`.prototype[@@toStringTag]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:</p>
<emu-alg>
1. Let _O_ be the *this* value.
1. If _O_ is not an Object, return *undefined*.
Expand Down