Skip to content

Commit

Permalink
Editorial: Rename some script-related aliases (tc39#2353)
Browse files Browse the repository at this point in the history
In ParseScript:
ParseText is invoked with |Script| as the goal,
so the result (if it isn't errors) is an instance of |Script|,
so change the alias `_body_` to `_script_`.

And note that the Script Record's [[ECMAScriptCode]] field
is also an instance of |Script|.

In ScriptEvaluation:
Since _scriptRecord_.[[ECMAScriptCode]] is an instance of |Script|,
change the alias `_scriptBody_` to `_script_`.
  • Loading branch information
jmdyck committed May 13, 2021
1 parent e4992ae commit 6436301
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -22450,9 +22450,9 @@ <h1>ParseScript ( _sourceText_, _realm_, _hostDefined_ )</h1>

<emu-alg>
1. Assert: _sourceText_ is an ECMAScript source text (see clause <emu-xref href="#sec-ecmascript-language-source-code"></emu-xref>).
1. Let _body_ be ParseText(_sourceText_, |Script|).
1. If _body_ is a List of errors, return _body_.
1. Return Script Record { [[Realm]]: _realm_, [[ECMAScriptCode]]: _body_, [[HostDefined]]: _hostDefined_ }.
1. Let _script_ be ParseText(_sourceText_, |Script|).
1. If _script_ is a List of errors, return _script_.
1. Return Script Record { [[Realm]]: _realm_, [[ECMAScriptCode]]: _script_, [[HostDefined]]: _hostDefined_ }.
</emu-alg>
<emu-note>
<p>An implementation may parse script source text and analyse it for Early Error conditions prior to evaluation of ParseScript for that script source text. However, the reporting of any errors must be deferred until the point where this specification actually performs ParseScript upon that source text.</p>
Expand All @@ -22474,10 +22474,10 @@ <h1>ScriptEvaluation ( _scriptRecord_ )</h1>
1. Set the PrivateEnvironment of _scriptContext_ to *null*.
1. Suspend the currently running execution context.
1. Push _scriptContext_ onto the execution context stack; _scriptContext_ is now the running execution context.
1. Let _scriptBody_ be _scriptRecord_.[[ECMAScriptCode]].
1. Let _result_ be GlobalDeclarationInstantiation(_scriptBody_, _globalEnv_).
1. Let _script_ be _scriptRecord_.[[ECMAScriptCode]].
1. Let _result_ be GlobalDeclarationInstantiation(_script_, _globalEnv_).
1. If _result_.[[Type]] is ~normal~, then
1. Set _result_ to the result of evaluating _scriptBody_.
1. Set _result_ to the result of evaluating _script_.
1. If _result_.[[Type]] is ~normal~ and _result_.[[Value]] is ~empty~, then
1. Set _result_ to NormalCompletion(*undefined*).
1. Suspend _scriptContext_ and remove it from the execution context stack.
Expand Down

0 comments on commit 6436301

Please sign in to comment.