diff --git a/test/language/expressions/arrow-function/scope-param-elem-var-close.js b/test/language/expressions/arrow-function/scope-param-elem-var-close.js index bcb987ebb9..0bac2f80de 100644 --- a/test/language/expressions/arrow-function/scope-param-elem-var-close.js +++ b/test/language/expressions/arrow-function/scope-param-elem-var-close.js @@ -1,18 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Removal of variable environment for each BindingElement formal parameter + sloppy direct evals in params introduce vars info: | [...] - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] ---*/ @@ -28,5 +26,5 @@ var probe1, probe2, probeBody; })(); assert.sameValue(probe1(), 'inside'); -assert.sameValue(probe2(), 'outside'); -assert.sameValue(probeBody(), 'outside'); +assert.sameValue(probe2(), 'inside'); +assert.sameValue(probeBody(), 'inside'); diff --git a/test/language/expressions/arrow-function/scope-param-elem-var-open.js b/test/language/expressions/arrow-function/scope-param-elem-var-open.js index 7f60a06102..e9f2f0d0a8 100644 --- a/test/language/expressions/arrow-function/scope-param-elem-var-open.js +++ b/test/language/expressions/arrow-function/scope-param-elem-var-open.js @@ -1,19 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Creation of new variable environment for each BindingElement formal - parameter + sloppy direct evals in params introduce vars info: | [...] - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] ---*/ @@ -27,5 +24,5 @@ var probe1, probe2; ) => { })(); -assert.sameValue(probe1(), 'outside'); +assert.sameValue(probe1(), 'inside'); assert.sameValue(probe2(), 'inside'); diff --git a/test/language/expressions/arrow-function/scope-param-rest-elem-var-close.js b/test/language/expressions/arrow-function/scope-param-rest-elem-var-close.js index 976565a989..1c55c6d75a 100644 --- a/test/language/expressions/arrow-function/scope-param-rest-elem-var-close.js +++ b/test/language/expressions/arrow-function/scope-param-rest-elem-var-close.js @@ -1,24 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Removal of variable environment for the BindingRestElement formal parameter + sloppy direct evals in params introduce vars info: | [...] - 2. Let currentContext be the running execution context. - 3. Let originalEnv be the VariableEnvironment of currentContext. - 4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext - are the same. - 5. Assert: environment and originalEnv are the same. - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingRestElement using iteratorRecord and environment as the - arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] ---*/ @@ -33,4 +25,4 @@ var probeParam, probeBody; })(); assert.sameValue(probeParam(), 'inside'); -assert.sameValue(probeBody(), 'outside'); +assert.sameValue(probeBody(), 'inside'); diff --git a/test/language/expressions/arrow-function/scope-param-rest-elem-var-open.js b/test/language/expressions/arrow-function/scope-param-rest-elem-var-open.js index b7a88bc050..6de472e6f3 100644 --- a/test/language/expressions/arrow-function/scope-param-rest-elem-var-open.js +++ b/test/language/expressions/arrow-function/scope-param-rest-elem-var-open.js @@ -1,24 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Creation of new variable environment for the BindingRestElement formal - parameter + sloppy direct evals in params introduce vars info: | [...] - 2. Let currentContext be the running execution context. - 3. Let originalEnv be the VariableEnvironment of currentContext. - 4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext - are the same. - 5. Assert: environment and originalEnv are the same. - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingRestElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] ---*/ @@ -32,5 +24,5 @@ var probe1, probe2; ) => { })(); -assert.sameValue(probe1(), 'outside'); +assert.sameValue(probe1(), 'inside'); assert.sameValue(probe2(), 'inside'); diff --git a/test/language/expressions/function/scope-param-elem-var-close.js b/test/language/expressions/function/scope-param-elem-var-close.js index 4b7ffe8bc0..de88cb9bd9 100644 --- a/test/language/expressions/function/scope-param-elem-var-close.js +++ b/test/language/expressions/function/scope-param-elem-var-close.js @@ -1,18 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Removal of variable environment for each BindingElement formal parameter + sloppy direct evals in params introduce vars info: | [...] - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] ---*/ @@ -28,5 +26,5 @@ var probe1, probe2, probeBody; }()); assert.sameValue(probe1(), 'inside'); -assert.sameValue(probe2(), 'outside'); -assert.sameValue(probeBody(), 'outside'); +assert.sameValue(probe2(), 'inside'); +assert.sameValue(probeBody(), 'inside'); diff --git a/test/language/expressions/function/scope-param-elem-var-open.js b/test/language/expressions/function/scope-param-elem-var-open.js index 5306666a70..8125503042 100644 --- a/test/language/expressions/function/scope-param-elem-var-open.js +++ b/test/language/expressions/function/scope-param-elem-var-open.js @@ -1,19 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Creation of new variable environment for each BindingElement formal - parameter + sloppy direct evals in params introduce vars info: | [...] - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] ---*/ @@ -27,5 +24,5 @@ var probe1, probe2; ) { }()); -assert.sameValue(probe1(), 'outside'); +assert.sameValue(probe1(), 'inside'); assert.sameValue(probe2(), 'inside'); diff --git a/test/language/expressions/function/scope-param-rest-elem-var-close.js b/test/language/expressions/function/scope-param-rest-elem-var-close.js index 413efdba4d..2829aeb6a0 100644 --- a/test/language/expressions/function/scope-param-rest-elem-var-close.js +++ b/test/language/expressions/function/scope-param-rest-elem-var-close.js @@ -1,24 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Removal of variable environment for the BindingRestElement formal parameter + sloppy direct evals in params introduce vars info: | [...] - 2. Let currentContext be the running execution context. - 3. Let originalEnv be the VariableEnvironment of currentContext. - 4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext - are the same. - 5. Assert: environment and originalEnv are the same. - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingRestElement using iteratorRecord and environment as the - arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] ---*/ @@ -33,4 +25,4 @@ var probeParam, probeBody; }()); assert.sameValue(probeParam(), 'inside'); -assert.sameValue(probeBody(), 'outside'); +assert.sameValue(probeBody(), 'inside'); diff --git a/test/language/expressions/function/scope-param-rest-elem-var-open.js b/test/language/expressions/function/scope-param-rest-elem-var-open.js index dcac19412c..f0f115e3ec 100644 --- a/test/language/expressions/function/scope-param-rest-elem-var-open.js +++ b/test/language/expressions/function/scope-param-rest-elem-var-open.js @@ -1,24 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Creation of new variable environment for the BindingRestElement formal - parameter + sloppy direct evals in params introduce vars info: | [...] - 2. Let currentContext be the running execution context. - 3. Let originalEnv be the VariableEnvironment of currentContext. - 4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext - are the same. - 5. Assert: environment and originalEnv are the same. - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingRestElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] ---*/ @@ -32,5 +24,5 @@ var probe1, probe2; ) { }()); -assert.sameValue(probe1(), 'outside'); +assert.sameValue(probe1(), 'inside'); assert.sameValue(probe2(), 'inside'); diff --git a/test/language/expressions/generators/scope-param-elem-var-close.js b/test/language/expressions/generators/scope-param-elem-var-close.js index 1ab9b37209..2ed5eedbfe 100644 --- a/test/language/expressions/generators/scope-param-elem-var-close.js +++ b/test/language/expressions/generators/scope-param-elem-var-close.js @@ -1,18 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Removal of variable environment for each BindingElement formal parameter + sloppy direct evals in params introduce vars info: | [...] - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] features: [generators] @@ -29,5 +27,5 @@ var probe1, probe2, probeBody; }()).next(); assert.sameValue(probe1(), 'inside'); -assert.sameValue(probe2(), 'outside'); -assert.sameValue(probeBody(), 'outside'); +assert.sameValue(probe2(), 'inside'); +assert.sameValue(probeBody(), 'inside'); diff --git a/test/language/expressions/generators/scope-param-elem-var-open.js b/test/language/expressions/generators/scope-param-elem-var-open.js index 0e1b928285..3fe1aa46a2 100644 --- a/test/language/expressions/generators/scope-param-elem-var-open.js +++ b/test/language/expressions/generators/scope-param-elem-var-open.js @@ -1,19 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Creation of new variable environment for each BindingElement formal - parameter + sloppy direct evals in params introduce vars info: | [...] - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] features: [generators] @@ -28,5 +25,5 @@ var probe1, probe2; ) { }().next()); -assert.sameValue(probe1(), 'outside'); +assert.sameValue(probe1(), 'inside'); assert.sameValue(probe2(), 'inside'); diff --git a/test/language/expressions/generators/scope-param-rest-elem-var-close.js b/test/language/expressions/generators/scope-param-rest-elem-var-close.js index 2081c5ae5d..95446256dd 100644 --- a/test/language/expressions/generators/scope-param-rest-elem-var-close.js +++ b/test/language/expressions/generators/scope-param-rest-elem-var-close.js @@ -1,24 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Removal of variable environment for the BindingRestElement formal parameter + sloppy direct evals in params introduce vars info: | [...] - 2. Let currentContext be the running execution context. - 3. Let originalEnv be the VariableEnvironment of currentContext. - 4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext - are the same. - 5. Assert: environment and originalEnv are the same. - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingRestElement using iteratorRecord and environment as the - arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] features: [generators] @@ -34,4 +26,4 @@ var probeParam, probeBody; }().next()); assert.sameValue(probeParam(), 'inside'); -assert.sameValue(probeBody(), 'outside'); +assert.sameValue(probeBody(), 'inside'); diff --git a/test/language/expressions/generators/scope-param-rest-elem-var-open.js b/test/language/expressions/generators/scope-param-rest-elem-var-open.js index 4bb3734fea..3aab2cac95 100644 --- a/test/language/expressions/generators/scope-param-rest-elem-var-open.js +++ b/test/language/expressions/generators/scope-param-rest-elem-var-open.js @@ -1,24 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Creation of new variable environment for the BindingRestElement formal - parameter + sloppy direct evals in params introduce vars info: | [...] - 2. Let currentContext be the running execution context. - 3. Let originalEnv be the VariableEnvironment of currentContext. - 4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext - are the same. - 5. Assert: environment and originalEnv are the same. - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingRestElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] features: [generators] @@ -33,5 +25,5 @@ var probe1, probe2; ) { }().next()); -assert.sameValue(probe1(), 'outside'); +assert.sameValue(probe1(), 'inside'); assert.sameValue(probe2(), 'inside'); diff --git a/test/language/expressions/object/scope-gen-meth-param-elem-var-close.js b/test/language/expressions/object/scope-gen-meth-param-elem-var-close.js index a9ea498651..0c5ee49ef4 100644 --- a/test/language/expressions/object/scope-gen-meth-param-elem-var-close.js +++ b/test/language/expressions/object/scope-gen-meth-param-elem-var-close.js @@ -1,18 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Removal of variable environment for each BindingElement formal parameter + sloppy direct evals in params introduce vars info: | [...] - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] features: [generators] @@ -31,5 +29,5 @@ var probe1, probe2, probeBody; }.m().next()); assert.sameValue(probe1(), 'inside'); -assert.sameValue(probe2(), 'outside'); -assert.sameValue(probeBody(), 'outside'); +assert.sameValue(probe2(), 'inside'); +assert.sameValue(probeBody(), 'inside'); diff --git a/test/language/expressions/object/scope-gen-meth-param-elem-var-open.js b/test/language/expressions/object/scope-gen-meth-param-elem-var-open.js index bb9b6f17ab..018917898f 100644 --- a/test/language/expressions/object/scope-gen-meth-param-elem-var-open.js +++ b/test/language/expressions/object/scope-gen-meth-param-elem-var-open.js @@ -1,19 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Creation of new variable environment for each BindingElement formal - parameter + sloppy direct evals in params introduce vars info: | [...] - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] features: [generators] @@ -29,5 +26,5 @@ var probe1, probe2; ) {} }.m().next()); -assert.sameValue(probe1(), 'outside'); +assert.sameValue(probe1(), 'inside'); assert.sameValue(probe2(), 'inside'); diff --git a/test/language/expressions/object/scope-gen-meth-param-rest-elem-var-close.js b/test/language/expressions/object/scope-gen-meth-param-rest-elem-var-close.js index d8a6058849..7439ab0e08 100644 --- a/test/language/expressions/object/scope-gen-meth-param-rest-elem-var-close.js +++ b/test/language/expressions/object/scope-gen-meth-param-rest-elem-var-close.js @@ -1,24 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Removal of variable environment for the BindingRestElement formal parameter + sloppy direct evals in params introduce vars info: | [...] - 2. Let currentContext be the running execution context. - 3. Let originalEnv be the VariableEnvironment of currentContext. - 4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext - are the same. - 5. Assert: environment and originalEnv are the same. - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingRestElement using iteratorRecord and environment as the - arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] features: [generators] @@ -36,4 +28,4 @@ var probeParam, probeBody; }.m().next()); assert.sameValue(probeParam(), 'inside'); -assert.sameValue(probeBody(), 'outside'); +assert.sameValue(probeBody(), 'inside'); diff --git a/test/language/expressions/object/scope-gen-meth-param-rest-elem-var-open.js b/test/language/expressions/object/scope-gen-meth-param-rest-elem-var-open.js index 43121e8859..23365b711b 100644 --- a/test/language/expressions/object/scope-gen-meth-param-rest-elem-var-open.js +++ b/test/language/expressions/object/scope-gen-meth-param-rest-elem-var-open.js @@ -1,24 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Creation of new variable environment for the BindingRestElement formal - parameter + sloppy direct evals in params introduce vars info: | [...] - 2. Let currentContext be the running execution context. - 3. Let originalEnv be the VariableEnvironment of currentContext. - 4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext - are the same. - 5. Assert: environment and originalEnv are the same. - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingRestElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] features: [generators] @@ -34,5 +26,5 @@ var probe1, probe2; ) {} }.m().next()); -assert.sameValue(probe1(), 'outside'); +assert.sameValue(probe1(), 'inside'); assert.sameValue(probe2(), 'inside'); diff --git a/test/language/expressions/object/scope-meth-param-elem-var-close.js b/test/language/expressions/object/scope-meth-param-elem-var-close.js index 66e9911e2c..b062853d74 100644 --- a/test/language/expressions/object/scope-meth-param-elem-var-close.js +++ b/test/language/expressions/object/scope-meth-param-elem-var-close.js @@ -1,18 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Removal of variable environment for each BindingElement formal parameter + sloppy direct evals in params introduce vars info: | [...] - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] ---*/ @@ -30,5 +28,5 @@ var probe1, probe2, probeBody; }.m()); assert.sameValue(probe1(), 'inside'); -assert.sameValue(probe2(), 'outside'); -assert.sameValue(probeBody(), 'outside'); +assert.sameValue(probe2(), 'inside'); +assert.sameValue(probeBody(), 'inside'); diff --git a/test/language/expressions/object/scope-meth-param-elem-var-open.js b/test/language/expressions/object/scope-meth-param-elem-var-open.js index ee8ecef830..db5e13112e 100644 --- a/test/language/expressions/object/scope-meth-param-elem-var-open.js +++ b/test/language/expressions/object/scope-meth-param-elem-var-open.js @@ -1,19 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Creation of new variable environment for each BindingElement formal - parameter + sloppy direct evals in params introduce vars info: | [...] - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] ---*/ @@ -28,5 +25,5 @@ var probe1, probe2; ) {} }.m()); -assert.sameValue(probe1(), 'outside'); +assert.sameValue(probe1(), 'inside'); assert.sameValue(probe2(), 'inside'); diff --git a/test/language/expressions/object/scope-meth-param-rest-elem-var-close.js b/test/language/expressions/object/scope-meth-param-rest-elem-var-close.js index ea74544609..ee9fe580db 100644 --- a/test/language/expressions/object/scope-meth-param-rest-elem-var-close.js +++ b/test/language/expressions/object/scope-meth-param-rest-elem-var-close.js @@ -1,24 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Removal of variable environment for the BindingRestElement formal parameter + sloppy direct evals in params introduce vars info: | [...] - 2. Let currentContext be the running execution context. - 3. Let originalEnv be the VariableEnvironment of currentContext. - 4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext - are the same. - 5. Assert: environment and originalEnv are the same. - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingRestElement using iteratorRecord and environment as the - arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] ---*/ @@ -35,4 +27,4 @@ var probeParam, probeBody; }.m()); assert.sameValue(probeParam(), 'inside'); -assert.sameValue(probeBody(), 'outside'); +assert.sameValue(probeBody(), 'inside'); diff --git a/test/language/expressions/object/scope-meth-param-rest-elem-var-open.js b/test/language/expressions/object/scope-meth-param-rest-elem-var-open.js index 27ff352798..959b9c29a2 100644 --- a/test/language/expressions/object/scope-meth-param-rest-elem-var-open.js +++ b/test/language/expressions/object/scope-meth-param-rest-elem-var-open.js @@ -1,24 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Creation of new variable environment for the BindingRestElement formal - parameter + sloppy direct evals in params introduce vars info: | [...] - 2. Let currentContext be the running execution context. - 3. Let originalEnv be the VariableEnvironment of currentContext. - 4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext - are the same. - 5. Assert: environment and originalEnv are the same. - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingRestElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] ---*/ @@ -33,5 +25,5 @@ var probe1, probe2; ) {} }.m()); -assert.sameValue(probe1(), 'outside'); +assert.sameValue(probe1(), 'inside'); assert.sameValue(probe2(), 'inside'); diff --git a/test/language/function-code/each-param-has-own-non-shared-eval-scope.js b/test/language/function-code/each-param-has-own-non-shared-eval-scope.js deleted file mode 100644 index d165776195..0000000000 --- a/test/language/function-code/each-param-has-own-non-shared-eval-scope.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (C) 2017 Rick Waldron. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization -description: > - A new declarative environment is created, from the originalEnv, for each - parameter, and paramVarEnv is not shared. -info: | - Runtime Semantics: IteratorBindingInitialization - - FormalParameter : BindingElement - - ... - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - ... - -features: [arrow-function, default-parameters] ----*/ - -var y; -function f(a = eval("var x = 1; y = 42; x"), b = eval("x")) {} - -assert.throws(ReferenceError, () => { - f(); -}); - -assert.sameValue(y, 42); diff --git a/test/language/function-code/each-param-has-own-scope.js b/test/language/function-code/each-param-has-own-scope.js deleted file mode 100644 index 83edc9ad98..0000000000 --- a/test/language/function-code/each-param-has-own-scope.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2017 Rick Waldron. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization -description: A new declarative environment is created, from the originalEnv, for each parameter. -info: | - Runtime Semantics: IteratorBindingInitialization - - FormalParameter : BindingElement - - ... - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - ... - -features: [arrow-function, default-parameters] ----*/ - -var y; -function f(a = eval("var x = 1; y = 42; x"), b = x) {} - -assert.throws(ReferenceError, () => { - f(); -}); - -assert.sameValue(y, 42); diff --git a/test/language/function-code/eval-param-env-with-computed-key.js b/test/language/function-code/eval-param-env-with-computed-key.js index 87ee94ad4b..fcba5cb7cc 100644 --- a/test/language/function-code/eval-param-env-with-computed-key.js +++ b/test/language/function-code/eval-param-env-with-computed-key.js @@ -2,25 +2,23 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization -description: If a computed property key contains a direct eval call, a new declarative environment is created. +esid: sec-functiondeclarationinstantiation +description: > + sloppy direct evals in params introduce vars info: | - Runtime Semantics: IteratorBindingInitialization - - FormalParameter : BindingElement - - ... - 2. Let currentContext be the running execution context. - 3. Let originalEnv be the VariableEnvironment of currentContext. - 4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext are the same. - 5. Assert: environment and originalEnv are the same. - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - ... + [...] + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. + [...] +flags: [noStrict] ---*/ var x = "outer"; function evalInComputedPropertyKey({[eval("var x = 'inner'")]: ignored}) { - assert.sameValue(x, "outer"); + assert.sameValue(x, "inner"); } evalInComputedPropertyKey({}); diff --git a/test/language/function-code/eval-param-env-with-prop-initializer.js b/test/language/function-code/eval-param-env-with-prop-initializer.js index 267dcc2d02..729484ece2 100644 --- a/test/language/function-code/eval-param-env-with-prop-initializer.js +++ b/test/language/function-code/eval-param-env-with-prop-initializer.js @@ -2,25 +2,23 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization -description: If a property initializer contains a direct eval call, a new declarative environment is created. +esid: sec-functiondeclarationinstantiation +description: > + sloppy direct evals in params introduce vars info: | - Runtime Semantics: IteratorBindingInitialization - - FormalParameter : BindingElement - - ... - 2. Let currentContext be the running execution context. - 3. Let originalEnv be the VariableEnvironment of currentContext. - 4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext are the same. - 5. Assert: environment and originalEnv are the same. - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - ... + [...] + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. + [...] +flags: [noStrict] ---*/ var x = "outer"; function evalInPropertyInitializer({a: ignored = eval("var x = 'inner'")}) { - assert.sameValue(x, "outer"); + assert.sameValue(x, "inner"); } evalInPropertyInitializer({}); diff --git a/test/language/statements/class/subclass/default-constructor-spread-override.js b/test/language/statements/class/subclass/default-constructor-spread-override.js index 197d5ff634..b3a7babcec 100644 --- a/test/language/statements/class/subclass/default-constructor-spread-override.js +++ b/test/language/statements/class/subclass/default-constructor-spread-override.js @@ -17,9 +17,7 @@ info: | 14.1.19 Runtime Semantics: IteratorBindingInitialization `FunctionRestParameter : BindingRestElement` - ... - 9. Let result be the result of performing IteratorBindingInitialization for BindingRestElement using iteratorRecord and environment as the arguments. - ... + 1. Let result be IteratorBindingInitialization of BindingRestElement with arguments iteratorRecord and environment. 13.3.3.6 Runtime Semantics: IteratorBindingInitialization `BindingRestElement : ...BindingIdentifier` diff --git a/test/language/statements/function/scope-param-elem-var-close.js b/test/language/statements/function/scope-param-elem-var-close.js index f7f0a3a6a1..65b35c4d00 100644 --- a/test/language/statements/function/scope-param-elem-var-close.js +++ b/test/language/statements/function/scope-param-elem-var-close.js @@ -1,18 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Removal of variable environment for each BindingElement formal parameter + sloppy direct evals in params introduce vars info: | [...] - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] ---*/ @@ -29,5 +27,5 @@ function f( f(); assert.sameValue(probe1(), 'inside'); -assert.sameValue(probe2(), 'outside'); -assert.sameValue(probeBody(), 'outside'); +assert.sameValue(probe2(), 'inside'); +assert.sameValue(probeBody(), 'inside'); diff --git a/test/language/statements/function/scope-param-elem-var-open.js b/test/language/statements/function/scope-param-elem-var-open.js index 18e2442245..67971bf56f 100644 --- a/test/language/statements/function/scope-param-elem-var-open.js +++ b/test/language/statements/function/scope-param-elem-var-open.js @@ -1,19 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Creation of new variable environment for each BindingElement formal - parameter + sloppy direct evals in params introduce vars info: | [...] - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] ---*/ @@ -28,5 +25,5 @@ function f( } f(); -assert.sameValue(probe1(), 'outside'); +assert.sameValue(probe1(), 'inside'); assert.sameValue(probe2(), 'inside'); diff --git a/test/language/statements/function/scope-param-rest-elem-var-close.js b/test/language/statements/function/scope-param-rest-elem-var-close.js index 1c32484046..17d097ef7d 100644 --- a/test/language/statements/function/scope-param-rest-elem-var-close.js +++ b/test/language/statements/function/scope-param-rest-elem-var-close.js @@ -1,24 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Removal of variable environment for the BindingRestElement formal parameter + sloppy direct evals in params introduce vars info: | [...] - 2. Let currentContext be the running execution context. - 3. Let originalEnv be the VariableEnvironment of currentContext. - 4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext - are the same. - 5. Assert: environment and originalEnv are the same. - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingRestElement using iteratorRecord and environment as the - arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] ---*/ @@ -34,4 +26,4 @@ function f( f(); assert.sameValue(probeParam(), 'inside'); -assert.sameValue(probeBody(), 'outside'); +assert.sameValue(probeBody(), 'inside'); diff --git a/test/language/statements/function/scope-param-rest-elem-var-open.js b/test/language/statements/function/scope-param-rest-elem-var-open.js index 632fd2f3c2..a9211a7de4 100644 --- a/test/language/statements/function/scope-param-rest-elem-var-open.js +++ b/test/language/statements/function/scope-param-rest-elem-var-open.js @@ -1,24 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Creation of new variable environment for the BindingRestElement formal - parameter + sloppy direct evals in params introduce vars info: | [...] - 2. Let currentContext be the running execution context. - 3. Let originalEnv be the VariableEnvironment of currentContext. - 4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext - are the same. - 5. Assert: environment and originalEnv are the same. - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingRestElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] ---*/ @@ -33,5 +25,5 @@ function f( } f(); -assert.sameValue(probe1(), 'outside'); +assert.sameValue(probe1(), 'inside'); assert.sameValue(probe2(), 'inside'); diff --git a/test/language/statements/generators/scope-param-elem-var-close.js b/test/language/statements/generators/scope-param-elem-var-close.js index f3e509a178..b18fdc3243 100644 --- a/test/language/statements/generators/scope-param-elem-var-close.js +++ b/test/language/statements/generators/scope-param-elem-var-close.js @@ -1,18 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Removal of variable environment for each BindingElement formal parameter + sloppy direct evals in params introduce vars info: | [...] - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] features: [generators] @@ -30,5 +28,5 @@ function* g( g().next(); assert.sameValue(probe1(), 'inside'); -assert.sameValue(probe2(), 'outside'); -assert.sameValue(probeBody(), 'outside'); +assert.sameValue(probe2(), 'inside'); +assert.sameValue(probeBody(), 'inside'); diff --git a/test/language/statements/generators/scope-param-elem-var-open.js b/test/language/statements/generators/scope-param-elem-var-open.js index 65eeac82a8..8b51c95ad4 100644 --- a/test/language/statements/generators/scope-param-elem-var-open.js +++ b/test/language/statements/generators/scope-param-elem-var-open.js @@ -1,19 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Creation of new variable environment for each BindingElement formal - parameter + sloppy direct evals in params introduce vars info: | [...] - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] features: [generators] @@ -29,5 +26,5 @@ function* g( } g().next(); -assert.sameValue(probe1(), 'outside'); +assert.sameValue(probe1(), 'inside'); assert.sameValue(probe2(), 'inside'); diff --git a/test/language/statements/generators/scope-param-rest-elem-var-close.js b/test/language/statements/generators/scope-param-rest-elem-var-close.js index 1e9dc5de5f..45a6944262 100644 --- a/test/language/statements/generators/scope-param-rest-elem-var-close.js +++ b/test/language/statements/generators/scope-param-rest-elem-var-close.js @@ -1,24 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Removal of variable environment for the BindingRestElement formal parameter + sloppy direct evals in params introduce vars info: | [...] - 2. Let currentContext be the running execution context. - 3. Let originalEnv be the VariableEnvironment of currentContext. - 4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext - are the same. - 5. Assert: environment and originalEnv are the same. - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingRestElement using iteratorRecord and environment as the - arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] features: [generators] @@ -35,4 +27,4 @@ function* g( g().next(); assert.sameValue(probeParam(), 'inside'); -assert.sameValue(probeBody(), 'outside'); +assert.sameValue(probeBody(), 'inside'); diff --git a/test/language/statements/generators/scope-param-rest-elem-var-open.js b/test/language/statements/generators/scope-param-rest-elem-var-open.js index 5831f32ddc..87eb62d010 100644 --- a/test/language/statements/generators/scope-param-rest-elem-var-open.js +++ b/test/language/statements/generators/scope-param-rest-elem-var-open.js @@ -1,24 +1,16 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization +esid: sec-functiondeclarationinstantiation description: > - Creation of new variable environment for the BindingRestElement formal - parameter + sloppy direct evals in params introduce vars info: | [...] - 2. Let currentContext be the running execution context. - 3. Let originalEnv be the VariableEnvironment of currentContext. - 4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext - are the same. - 5. Assert: environment and originalEnv are the same. - 6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv). - 7. Set the VariableEnvironment of currentContext to paramVarEnv. - 8. Set the LexicalEnvironment of currentContext to paramVarEnv. - 9. Let result be the result of performing IteratorBindingInitialization for - BindingRestElement using iteratorRecord and environment as the arguments. - 10. Set the VariableEnvironment of currentContext to originalEnv. - 11. Set the LexicalEnvironment of currentContext to originalEnv. + 20. Else, + a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. + b. Let calleeEnv be the LexicalEnvironment of calleeContext. + c. Let env be NewDeclarativeEnvironment(calleeEnv). + d. Let envRec be env's EnvironmentRecord. [...] flags: [noStrict] features: [generators] @@ -34,5 +26,5 @@ function* g( } g().next(); -assert.sameValue(probe1(), 'outside'); +assert.sameValue(probe1(), 'inside'); assert.sameValue(probe2(), 'inside');