Skip to content

Commit

Permalink
Remove ForBodyEvaluation/CreatePerIterationEnvironment
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuckton committed Jan 17, 2023
1 parent 9e197bc commit 3a6915f
Showing 1 changed file with 0 additions and 66 deletions.
66 changes: 0 additions & 66 deletions spec.emu
Expand Up @@ -2246,72 +2246,6 @@ contributors: Ron Buckton, Ecma International
1. Return ? _bodyResult_.
</emu-alg>
</emu-clause>

<emu-clause id="sec-forbodyevaluation" type="abstract operation">
<h1>
ForBodyEvaluation (
_test_: unknown,
_increment_: unknown,
_stmt_: unknown,
_perIterationBindings_: unknown,
_labelSet_: unknown,
): either a normal completion containing an ECMAScript language value or an abrupt completion
</h1>
<dl class="header">
</dl>
<emu-alg>
1. Let _V_ be *undefined*.
1. <del>Perform ? CreatePerIterationEnvironment(_perIterationBindings_).</del>
1. <ins>Let _thisIterationEnv_ be ? CreatePerIterationEnvironment(_perIterationBindings_).</ins>
1. Repeat,
1. If _test_ is not ~[empty]~, then
1. Let _testRef_ be the result of evaluating _test_.
1. <del>Let _testValue_ be ? GetValue(_testRef_).</del>
1. <ins>Let _testValue_ be Completion(GetValue(_testRef_)).</ins>
1. <ins>If _testValue_ is an abrupt completion, then</ins>
1. <ins>Return ? DisposeResources(_thisIterationEnv_, _testValue_).</ins>
1. <ins>Else,</ins>
1. <ins>Set _testValue_ to _testValue_.[[Value]].</ins>
1. <del>If ToBoolean(_testValue_) is *false*, return _V_.</del>
1. <ins>If ToBoolean(_testValue_) is *false*, return ? DisposeResources(_thisIterationEnv_, Completion(_V_)).</ins>
1. Let _result_ be the result of evaluating _stmt_.
1. <ins>Perform ? DisposeResources(_thisIterationEnv_, _result_).</ins>
1. If LoopContinues(_result_, _labelSet_) is *false*, return ? UpdateEmpty(_result_, _V_).
1. If _result_.[[Value]] is not ~empty~, set _V_ to _result_.[[Value]].
1. <del>Perform ? CreatePerIterationEnvironment(_perIterationBindings_).</del>
1. <ins>Set _thisIterationEnv_ to ? CreatePerIterationEnvironment(_perIterationBindings_).</ins>
1. If _increment_ is not ~[empty]~, then
1. Let _incRef_ be the result of evaluating _increment_.
1. <del>Perform ? GetValue(_incRef_).</del>
1. <ins>Let _incrResult_ be Completion(GetValue(_incrRef_)).</ins>
1. <ins>If _incrResult_ is an abrupt completion, then</ins>
1. <ins>Return ? DisposeResources(_thisIterationEnv_, _incrResult_).</ins>
</emu-alg>
</emu-clause>

<emu-clause id="sec-createperiterationenvironment" type="abstract operation">
<h1>
CreatePerIterationEnvironment (
_perIterationBindings_: unknown,
): either a normal completion containing either a Declarative Environment Record or ~unused~ or a throw completion
</h1>
<dl class="header">
</dl>
<emu-alg>
1. If _perIterationBindings_ has any elements, then
1. Let _lastIterationEnv_ be the running execution context's LexicalEnvironment.
1. Let _outer_ be _lastIterationEnv_.[[OuterEnv]].
1. Assert: _outer_ is not *null*.
1. Let _thisIterationEnv_ be NewDeclarativeEnvironment(_outer_).
1. For each element _bn_ of _perIterationBindings_, do
1. Perform ! _thisIterationEnv_.CreateMutableBinding(_bn_, *false*).
1. Let _lastValue_ be ? _lastIterationEnv_.GetBindingValue(_bn_, *true*).
1. Perform _thisIterationEnv_.InitializeBinding(_bn_, _lastValue_<ins>, ~normal~</ins>).
1. Set the running execution context's LexicalEnvironment to _thisIterationEnv_.
1. <ins>Return _thisIterationEnv_.</ins>
1. Return ~unused~.
</emu-alg>
</emu-clause>
</emu-clause>

<emu-clause id="sec-for-in-and-for-of-statements">
Expand Down

0 comments on commit 3a6915f

Please sign in to comment.