Skip to content

Commit

Permalink
Remove paramVarEnv from IteratorBindingInitialization of FormalParame…
Browse files Browse the repository at this point in the history
…ters
  • Loading branch information
ajklein authored and syg committed Dec 11, 2019
1 parent 618479a commit 47b3013
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -19318,40 +19318,12 @@ <h1>Runtime Semantics: IteratorBindingInitialization</h1>
</emu-alg>
<emu-grammar>FormalParameter : BindingElement</emu-grammar>
<emu-alg>
1. If ContainsExpression of |BindingElement| is *false*, return the result of performing IteratorBindingInitialization for |BindingElement| using _iteratorRecord_ and _environment_ as the arguments.
1. Let _currentContext_ be the running execution context.
1. Let _originalEnv_ be the VariableEnvironment of _currentContext_.
1. Assert: The VariableEnvironment and LexicalEnvironment of _currentContext_ are the same.
1. Assert: If _environment_ is not *undefined*, then _environment_ and _originalEnv_ are the same.
1. Let _paramVarEnv_ be NewDeclarativeEnvironment(_originalEnv_).
1. Set the VariableEnvironment of _currentContext_ to _paramVarEnv_.
1. Set the LexicalEnvironment of _currentContext_ to _paramVarEnv_.
1. Let _result_ be IteratorBindingInitialization of |BindingElement| with arguments _iteratorRecord_ and _environment_.
1. Set the VariableEnvironment of _currentContext_ to _originalEnv_.
1. Set the LexicalEnvironment of _currentContext_ to _originalEnv_.
1. Return _result_.
1. Return the result of performing IteratorBindingInitialization for |BindingElement| with arguments _iteratorRecord_ and _environment_.
</emu-alg>
<emu-note>
<p>The new Environment Record created in step 6 is only used if the |BindingElement| contains a direct eval.</p>
</emu-note>
<emu-grammar>FunctionRestParameter : BindingRestElement</emu-grammar>
<emu-alg>
1. If ContainsExpression of |BindingRestElement| is *false*, return the result of performing IteratorBindingInitialization for |BindingRestElement| using _iteratorRecord_ and _environment_ as the arguments.
1. Let _currentContext_ be the running execution context.
1. Let _originalEnv_ be the VariableEnvironment of _currentContext_.
1. Assert: The VariableEnvironment and LexicalEnvironment of _currentContext_ are the same.
1. Assert: If _environment_ is not *undefined*, then _environment_ and _originalEnv_ are the same.
1. Let _paramVarEnv_ be NewDeclarativeEnvironment(_originalEnv_).
1. Set the VariableEnvironment of _currentContext_ to _paramVarEnv_.
1. Set the LexicalEnvironment of _currentContext_ to _paramVarEnv_.
1. Let _result_ be IteratorBindingInitialization of |BindingRestElement| with arguments _iteratorRecord_ and _environment_.
1. Set the VariableEnvironment of _currentContext_ to _originalEnv_.
1. Set the LexicalEnvironment of _currentContext_ to _originalEnv_.
1. Return _result_.
1. Return the result of performing IteratorBindingInitialization for |BindingRestElement| with arguments _iteratorRecord_ and _environment_.
</emu-alg>
<emu-note>
<p>The new Environment Record created in step 6 is only used if the |BindingRestElement| contains a direct eval.</p>
</emu-note>
</emu-clause>

<emu-clause id="sec-function-definitions-runtime-semantics-instantiatefunctionobject">
Expand Down

0 comments on commit 47b3013

Please sign in to comment.