Update tests for removal of per-parameter position var scope (#2445)

See https://github.com/tc39/ecma262/pull/1046
This commit is contained in:
Shu-yu Guo 2019-12-23 19:36:09 +01:00 committed by Leo Balter
parent 31f1bb5a75
commit 27bda64012
33 changed files with 256 additions and 463 deletions

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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);

View File

@ -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);

View File

@ -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({});

View File

@ -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({});

View File

@ -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`

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');