Skip to content

Commit

Permalink
Editorial: Standardize preambles for Module Record concrete methods (#…
Browse files Browse the repository at this point in the history
…1994)

Reword preambles according to the format set out in issue #1981.

(In the process, drop occurrences of
"implements the corresponding Module Record abstract method"
from the former preambles: it doesn't add anything.)
  • Loading branch information
jmdyck authored and ljharb committed Dec 13, 2020
1 parent 52c3b8d commit 6cc1a6a
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -23034,12 +23034,9 @@ <h1>Cyclic Module Records</h1>

<emu-clause id="sec-moduledeclarationlinking" oldids="sec-moduledeclarationinstantiation">
<h1>Link ( ) Concrete Method</h1>
<p>The Link concrete method of a Cyclic Module Record implements the corresponding Module Record abstract method.</p>
<p>On success, Link transitions this module's [[Status]] from ~unlinked~ to ~linked~. On failure, an exception is thrown and this module's [[Status]] remains ~unlinked~.</p>
<p>This abstract method performs the following steps (most of the work is done by the auxiliary function InnerModuleLinking):</p>
<p>The Link concrete method of a Cyclic Module Record _module_ takes no arguments. On success, Link transitions this module's [[Status]] from ~unlinked~ to ~linked~. On failure, an exception is thrown and this module's [[Status]] remains ~unlinked~. (Most of the work is done by the auxiliary function InnerModuleLinking.) It performs the following steps when called:</p>

<emu-alg>
1. Let _module_ be this Cyclic Module Record.
1. Assert: _module_.[[Status]] is not ~linking~ or ~evaluating~.
1. Let _stack_ be a new empty List.
1. Let _result_ be InnerModuleLinking(_module_, _stack_, 0).
Expand Down Expand Up @@ -23099,14 +23096,10 @@ <h1>InnerModuleLinking ( _module_, _stack_, _index_ )</h1>

<emu-clause id="sec-moduleevaluation">
<h1>Evaluate ( ) Concrete Method</h1>
<p>The Evaluate concrete method of a Cyclic Module Record implements the corresponding Module Record abstract method.</p>
<p>Evaluate transitions this module's [[Status]] from ~linked~ to ~evaluated~.</p>
<p>If execution results in an exception, that exception is recorded in the [[EvaluationError]] field and rethrown by future invocations of Evaluate.</p>
<p>This abstract method performs the following steps (most of the work is done by the auxiliary function InnerModuleEvaluation):</p>
<p>The Evaluate concrete method of a Cyclic Module Record _module_ takes no arguments. Evaluate transitions this module's [[Status]] from ~linked~ to ~evaluated~. If execution results in an exception, that exception is recorded in the [[EvaluationError]] field and rethrown by future invocations of Evaluate. (Most of the work is done by the auxiliary function InnerModuleEvaluation.) It performs the following steps when called:</p>

<emu-alg>
1. Assert: This call to Evaluate is not happening at the same time as another call to Evaluate within the surrounding agent.
1. Let _module_ be this Cyclic Module Record.
1. Assert: _module_.[[Status]] is ~linked~ or ~evaluated~.
1. Let _stack_ be a new empty List.
1. Let _result_ be InnerModuleEvaluation(_module_, _stack_, 0).
Expand Down Expand Up @@ -23747,12 +23740,10 @@ <h1>ParseModule ( _sourceText_, _realm_, _hostDefined_ )</h1>

<emu-clause id="sec-getexportednames">
<h1>GetExportedNames ( [ _exportStarSet_ ] ) Concrete Method</h1>
<p>The GetExportedNames concrete method of a Source Text Module Record implements the corresponding Module Record abstract method.</p>
<p>It performs the following steps when called:</p>
<p>The GetExportedNames concrete method of a Source Text Module Record _module_ takes optional argument _exportStarSet_. It performs the following steps when called:</p>
<emu-alg>
1. If _exportStarSet_ is not present, set _exportStarSet_ to a new empty List.
1. Assert: _exportStarSet_ is a List of Source Text Module Records.
1. Let _module_ be this Source Text Module Record.
1. If _exportStarSet_ contains _module_, then
1. Assert: We've reached the starting point of an `export *` circularity.
1. Return a new empty List.
Expand Down Expand Up @@ -23780,15 +23771,14 @@ <h1>GetExportedNames ( [ _exportStarSet_ ] ) Concrete Method</h1>

<emu-clause id="sec-resolveexport">
<h1>ResolveExport ( _exportName_ [ , _resolveSet_ ] ) Concrete Method</h1>
<p>The ResolveExport concrete method of a Source Text Module Record implements the corresponding Module Record abstract method.</p>
<p>The ResolveExport concrete method of a Source Text Module Record _module_ takes argument _exportName_ (a String) and optional argument _resolveSet_.</p>
<p>ResolveExport attempts to resolve an imported binding to the actual defining module and local binding name. The defining module may be the module represented by the Module Record this method was invoked on or some other module that is imported by that module. The parameter _resolveSet_ is used to detect unresolved circular import/export paths. If a pair consisting of specific Module Record and _exportName_ is reached that is already in _resolveSet_, an import circularity has been encountered. Before recursively calling ResolveExport, a pair consisting of _module_ and _exportName_ is added to _resolveSet_.</p>
<p>If a defining module is found, a ResolvedBinding Record { [[Module]], [[BindingName]] } is returned. This record identifies the resolved binding of the originally requested export, unless this is the export of a namespace with no local binding. In this case, [[BindingName]] will be set to *"\*namespace\*"*. If no definition was found or the request is found to be circular, *null* is returned. If the request is found to be ambiguous, the string *"ambiguous"* is returned.</p>
<p>This abstract method performs the following steps:</p>
<p>This concrete method performs the following steps when called:</p>

<emu-alg>
1. If _resolveSet_ is not present, set _resolveSet_ to a new empty List.
1. Assert: _resolveSet_ is a List of Record { [[Module]], [[ExportName]] }.
1. Let _module_ be this Source Text Module Record.
1. For each Record { [[Module]], [[ExportName]] } _r_ of _resolveSet_, do
1. If _module_ and _r_.[[Module]] are the same Module Record and SameValue(_exportName_, _r_.[[ExportName]]) is *true*, then
1. Assert: This is a circular import request.
Expand Down Expand Up @@ -23828,11 +23818,9 @@ <h1>ResolveExport ( _exportName_ [ , _resolveSet_ ] ) Concrete Method</h1>

<emu-clause id="sec-source-text-module-record-initialize-environment" aoid="InitializeEnvironment">
<h1>InitializeEnvironment ( ) Concrete Method</h1>
<p>The InitializeEnvironment concrete method of a Source Text Module Record implements the corresponding Cyclic Module Record abstract method.</p>
<p>This abstract method performs the following steps:</p>
<p>The InitializeEnvironment concrete method of a Source Text Module Record _module_ takes no arguments. It performs the following steps when called:</p>

<emu-alg>
1. Let _module_ be this Source Text Module Record.
1. For each ExportEntry Record _e_ of _module_.[[IndirectExportEntries]], do
1. Let _resolution_ be ? _module_.ResolveExport(_e_.[[ExportName]]).
1. If _resolution_ is *null* or *"ambiguous"*, throw a *SyntaxError* exception.
Expand Down Expand Up @@ -23893,11 +23881,9 @@ <h1>InitializeEnvironment ( ) Concrete Method</h1>

<emu-clause id="sec-source-text-module-record-execute-module" aoid="ExecuteModule">
<h1>ExecuteModule ( ) Concrete Method</h1>
<p>The ExecuteModule concrete method of a Source Text Module Record implements the corresponding Cyclic Module Record abstract method.</p>
<p>This abstract method performs the following steps:</p>
<p>The ExecuteModule concrete method of a Source Text Module Record _module_ takes no arguments. It performs the following steps when called:</p>

<emu-alg>
1. Let _module_ be this Source Text Module Record.
1. Suspend the currently running execution context.
1. Let _moduleContext_ be _module_.[[Context]].
1. Push _moduleContext_ onto the execution context stack; _moduleContext_ is now the running execution context.
Expand Down

0 comments on commit 6cc1a6a

Please sign in to comment.