mirror of
https://github.com/tc39/test262.git
synced 2025-07-28 16:34:27 +02:00
Update tests for removal of per-parameter position var scope (#2445)
See https://github.com/tc39/ecma262/pull/1046
This commit is contained in:
parent
31f1bb5a75
commit
27bda64012
@ -1,18 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Removal of variable environment for each BindingElement formal parameter
|
sloppy direct evals in params introduce vars
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv).
|
20. Else,
|
||||||
7. Set the VariableEnvironment of currentContext to paramVarEnv.
|
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.
|
||||||
8. Set the LexicalEnvironment of currentContext to paramVarEnv.
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
9. Let result be the result of performing IteratorBindingInitialization for
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
BindingElement using iteratorRecord and environment as the arguments.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
10. Set the VariableEnvironment of currentContext to originalEnv.
|
|
||||||
11. Set the LexicalEnvironment of currentContext to originalEnv.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
@ -28,5 +26,5 @@ var probe1, probe2, probeBody;
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'inside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'outside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
assert.sameValue(probeBody(), 'outside');
|
assert.sameValue(probeBody(), 'inside');
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Creation of new variable environment for each BindingElement formal
|
sloppy direct evals in params introduce vars
|
||||||
parameter
|
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv).
|
20. Else,
|
||||||
7. Set the VariableEnvironment of currentContext to paramVarEnv.
|
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.
|
||||||
8. Set the LexicalEnvironment of currentContext to paramVarEnv.
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
9. Let result be the result of performing IteratorBindingInitialization for
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
BindingElement using iteratorRecord and environment as the arguments.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
10. Set the VariableEnvironment of currentContext to originalEnv.
|
|
||||||
11. Set the LexicalEnvironment of currentContext to originalEnv.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
@ -27,5 +24,5 @@ var probe1, probe2;
|
|||||||
) => {
|
) => {
|
||||||
})();
|
})();
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'outside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'inside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
|
@ -1,24 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Removal of variable environment for the BindingRestElement formal parameter
|
sloppy direct evals in params introduce vars
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
2. Let currentContext be the running execution context.
|
20. Else,
|
||||||
3. Let originalEnv be the VariableEnvironment of currentContext.
|
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.
|
||||||
4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
are the same.
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
5. Assert: environment and originalEnv are the same.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
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.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
@ -33,4 +25,4 @@ var probeParam, probeBody;
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
assert.sameValue(probeParam(), 'inside');
|
assert.sameValue(probeParam(), 'inside');
|
||||||
assert.sameValue(probeBody(), 'outside');
|
assert.sameValue(probeBody(), 'inside');
|
||||||
|
@ -1,24 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Creation of new variable environment for the BindingRestElement formal
|
sloppy direct evals in params introduce vars
|
||||||
parameter
|
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
2. Let currentContext be the running execution context.
|
20. Else,
|
||||||
3. Let originalEnv be the VariableEnvironment of currentContext.
|
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.
|
||||||
4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
are the same.
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
5. Assert: environment and originalEnv are the same.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
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.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
@ -32,5 +24,5 @@ var probe1, probe2;
|
|||||||
) => {
|
) => {
|
||||||
})();
|
})();
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'outside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'inside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
|
@ -1,18 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Removal of variable environment for each BindingElement formal parameter
|
sloppy direct evals in params introduce vars
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv).
|
20. Else,
|
||||||
7. Set the VariableEnvironment of currentContext to paramVarEnv.
|
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.
|
||||||
8. Set the LexicalEnvironment of currentContext to paramVarEnv.
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
9. Let result be the result of performing IteratorBindingInitialization for
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
BindingElement using iteratorRecord and environment as the arguments.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
10. Set the VariableEnvironment of currentContext to originalEnv.
|
|
||||||
11. Set the LexicalEnvironment of currentContext to originalEnv.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
@ -28,5 +26,5 @@ var probe1, probe2, probeBody;
|
|||||||
}());
|
}());
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'inside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'outside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
assert.sameValue(probeBody(), 'outside');
|
assert.sameValue(probeBody(), 'inside');
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Creation of new variable environment for each BindingElement formal
|
sloppy direct evals in params introduce vars
|
||||||
parameter
|
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv).
|
20. Else,
|
||||||
7. Set the VariableEnvironment of currentContext to paramVarEnv.
|
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.
|
||||||
8. Set the LexicalEnvironment of currentContext to paramVarEnv.
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
9. Let result be the result of performing IteratorBindingInitialization for
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
BindingElement using iteratorRecord and environment as the arguments.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
10. Set the VariableEnvironment of currentContext to originalEnv.
|
|
||||||
11. Set the LexicalEnvironment of currentContext to originalEnv.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
@ -27,5 +24,5 @@ var probe1, probe2;
|
|||||||
) {
|
) {
|
||||||
}());
|
}());
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'outside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'inside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
|
@ -1,24 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Removal of variable environment for the BindingRestElement formal parameter
|
sloppy direct evals in params introduce vars
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
2. Let currentContext be the running execution context.
|
20. Else,
|
||||||
3. Let originalEnv be the VariableEnvironment of currentContext.
|
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.
|
||||||
4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
are the same.
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
5. Assert: environment and originalEnv are the same.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
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.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
@ -33,4 +25,4 @@ var probeParam, probeBody;
|
|||||||
}());
|
}());
|
||||||
|
|
||||||
assert.sameValue(probeParam(), 'inside');
|
assert.sameValue(probeParam(), 'inside');
|
||||||
assert.sameValue(probeBody(), 'outside');
|
assert.sameValue(probeBody(), 'inside');
|
||||||
|
@ -1,24 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Creation of new variable environment for the BindingRestElement formal
|
sloppy direct evals in params introduce vars
|
||||||
parameter
|
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
2. Let currentContext be the running execution context.
|
20. Else,
|
||||||
3. Let originalEnv be the VariableEnvironment of currentContext.
|
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.
|
||||||
4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
are the same.
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
5. Assert: environment and originalEnv are the same.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
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.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
@ -32,5 +24,5 @@ var probe1, probe2;
|
|||||||
) {
|
) {
|
||||||
}());
|
}());
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'outside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'inside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
|
@ -1,18 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Removal of variable environment for each BindingElement formal parameter
|
sloppy direct evals in params introduce vars
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv).
|
20. Else,
|
||||||
7. Set the VariableEnvironment of currentContext to paramVarEnv.
|
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.
|
||||||
8. Set the LexicalEnvironment of currentContext to paramVarEnv.
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
9. Let result be the result of performing IteratorBindingInitialization for
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
BindingElement using iteratorRecord and environment as the arguments.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
10. Set the VariableEnvironment of currentContext to originalEnv.
|
|
||||||
11. Set the LexicalEnvironment of currentContext to originalEnv.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
features: [generators]
|
features: [generators]
|
||||||
@ -29,5 +27,5 @@ var probe1, probe2, probeBody;
|
|||||||
}()).next();
|
}()).next();
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'inside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'outside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
assert.sameValue(probeBody(), 'outside');
|
assert.sameValue(probeBody(), 'inside');
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Creation of new variable environment for each BindingElement formal
|
sloppy direct evals in params introduce vars
|
||||||
parameter
|
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv).
|
20. Else,
|
||||||
7. Set the VariableEnvironment of currentContext to paramVarEnv.
|
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.
|
||||||
8. Set the LexicalEnvironment of currentContext to paramVarEnv.
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
9. Let result be the result of performing IteratorBindingInitialization for
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
BindingElement using iteratorRecord and environment as the arguments.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
10. Set the VariableEnvironment of currentContext to originalEnv.
|
|
||||||
11. Set the LexicalEnvironment of currentContext to originalEnv.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
features: [generators]
|
features: [generators]
|
||||||
@ -28,5 +25,5 @@ var probe1, probe2;
|
|||||||
) {
|
) {
|
||||||
}().next());
|
}().next());
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'outside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'inside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
|
@ -1,24 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Removal of variable environment for the BindingRestElement formal parameter
|
sloppy direct evals in params introduce vars
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
2. Let currentContext be the running execution context.
|
20. Else,
|
||||||
3. Let originalEnv be the VariableEnvironment of currentContext.
|
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.
|
||||||
4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
are the same.
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
5. Assert: environment and originalEnv are the same.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
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.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
features: [generators]
|
features: [generators]
|
||||||
@ -34,4 +26,4 @@ var probeParam, probeBody;
|
|||||||
}().next());
|
}().next());
|
||||||
|
|
||||||
assert.sameValue(probeParam(), 'inside');
|
assert.sameValue(probeParam(), 'inside');
|
||||||
assert.sameValue(probeBody(), 'outside');
|
assert.sameValue(probeBody(), 'inside');
|
||||||
|
@ -1,24 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Creation of new variable environment for the BindingRestElement formal
|
sloppy direct evals in params introduce vars
|
||||||
parameter
|
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
2. Let currentContext be the running execution context.
|
20. Else,
|
||||||
3. Let originalEnv be the VariableEnvironment of currentContext.
|
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.
|
||||||
4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
are the same.
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
5. Assert: environment and originalEnv are the same.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
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.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
features: [generators]
|
features: [generators]
|
||||||
@ -33,5 +25,5 @@ var probe1, probe2;
|
|||||||
) {
|
) {
|
||||||
}().next());
|
}().next());
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'outside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'inside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
|
@ -1,18 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Removal of variable environment for each BindingElement formal parameter
|
sloppy direct evals in params introduce vars
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv).
|
20. Else,
|
||||||
7. Set the VariableEnvironment of currentContext to paramVarEnv.
|
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.
|
||||||
8. Set the LexicalEnvironment of currentContext to paramVarEnv.
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
9. Let result be the result of performing IteratorBindingInitialization for
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
BindingElement using iteratorRecord and environment as the arguments.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
10. Set the VariableEnvironment of currentContext to originalEnv.
|
|
||||||
11. Set the LexicalEnvironment of currentContext to originalEnv.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
features: [generators]
|
features: [generators]
|
||||||
@ -31,5 +29,5 @@ var probe1, probe2, probeBody;
|
|||||||
}.m().next());
|
}.m().next());
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'inside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'outside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
assert.sameValue(probeBody(), 'outside');
|
assert.sameValue(probeBody(), 'inside');
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Creation of new variable environment for each BindingElement formal
|
sloppy direct evals in params introduce vars
|
||||||
parameter
|
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv).
|
20. Else,
|
||||||
7. Set the VariableEnvironment of currentContext to paramVarEnv.
|
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.
|
||||||
8. Set the LexicalEnvironment of currentContext to paramVarEnv.
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
9. Let result be the result of performing IteratorBindingInitialization for
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
BindingElement using iteratorRecord and environment as the arguments.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
10. Set the VariableEnvironment of currentContext to originalEnv.
|
|
||||||
11. Set the LexicalEnvironment of currentContext to originalEnv.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
features: [generators]
|
features: [generators]
|
||||||
@ -29,5 +26,5 @@ var probe1, probe2;
|
|||||||
) {}
|
) {}
|
||||||
}.m().next());
|
}.m().next());
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'outside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'inside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
|
@ -1,24 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Removal of variable environment for the BindingRestElement formal parameter
|
sloppy direct evals in params introduce vars
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
2. Let currentContext be the running execution context.
|
20. Else,
|
||||||
3. Let originalEnv be the VariableEnvironment of currentContext.
|
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.
|
||||||
4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
are the same.
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
5. Assert: environment and originalEnv are the same.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
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.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
features: [generators]
|
features: [generators]
|
||||||
@ -36,4 +28,4 @@ var probeParam, probeBody;
|
|||||||
}.m().next());
|
}.m().next());
|
||||||
|
|
||||||
assert.sameValue(probeParam(), 'inside');
|
assert.sameValue(probeParam(), 'inside');
|
||||||
assert.sameValue(probeBody(), 'outside');
|
assert.sameValue(probeBody(), 'inside');
|
||||||
|
@ -1,24 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Creation of new variable environment for the BindingRestElement formal
|
sloppy direct evals in params introduce vars
|
||||||
parameter
|
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
2. Let currentContext be the running execution context.
|
20. Else,
|
||||||
3. Let originalEnv be the VariableEnvironment of currentContext.
|
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.
|
||||||
4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
are the same.
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
5. Assert: environment and originalEnv are the same.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
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.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
features: [generators]
|
features: [generators]
|
||||||
@ -34,5 +26,5 @@ var probe1, probe2;
|
|||||||
) {}
|
) {}
|
||||||
}.m().next());
|
}.m().next());
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'outside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'inside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
|
@ -1,18 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Removal of variable environment for each BindingElement formal parameter
|
sloppy direct evals in params introduce vars
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv).
|
20. Else,
|
||||||
7. Set the VariableEnvironment of currentContext to paramVarEnv.
|
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.
|
||||||
8. Set the LexicalEnvironment of currentContext to paramVarEnv.
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
9. Let result be the result of performing IteratorBindingInitialization for
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
BindingElement using iteratorRecord and environment as the arguments.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
10. Set the VariableEnvironment of currentContext to originalEnv.
|
|
||||||
11. Set the LexicalEnvironment of currentContext to originalEnv.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
@ -30,5 +28,5 @@ var probe1, probe2, probeBody;
|
|||||||
}.m());
|
}.m());
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'inside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'outside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
assert.sameValue(probeBody(), 'outside');
|
assert.sameValue(probeBody(), 'inside');
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Creation of new variable environment for each BindingElement formal
|
sloppy direct evals in params introduce vars
|
||||||
parameter
|
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv).
|
20. Else,
|
||||||
7. Set the VariableEnvironment of currentContext to paramVarEnv.
|
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.
|
||||||
8. Set the LexicalEnvironment of currentContext to paramVarEnv.
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
9. Let result be the result of performing IteratorBindingInitialization for
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
BindingElement using iteratorRecord and environment as the arguments.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
10. Set the VariableEnvironment of currentContext to originalEnv.
|
|
||||||
11. Set the LexicalEnvironment of currentContext to originalEnv.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
@ -28,5 +25,5 @@ var probe1, probe2;
|
|||||||
) {}
|
) {}
|
||||||
}.m());
|
}.m());
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'outside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'inside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
|
@ -1,24 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Removal of variable environment for the BindingRestElement formal parameter
|
sloppy direct evals in params introduce vars
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
2. Let currentContext be the running execution context.
|
20. Else,
|
||||||
3. Let originalEnv be the VariableEnvironment of currentContext.
|
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.
|
||||||
4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
are the same.
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
5. Assert: environment and originalEnv are the same.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
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.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
@ -35,4 +27,4 @@ var probeParam, probeBody;
|
|||||||
}.m());
|
}.m());
|
||||||
|
|
||||||
assert.sameValue(probeParam(), 'inside');
|
assert.sameValue(probeParam(), 'inside');
|
||||||
assert.sameValue(probeBody(), 'outside');
|
assert.sameValue(probeBody(), 'inside');
|
||||||
|
@ -1,24 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Creation of new variable environment for the BindingRestElement formal
|
sloppy direct evals in params introduce vars
|
||||||
parameter
|
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
2. Let currentContext be the running execution context.
|
20. Else,
|
||||||
3. Let originalEnv be the VariableEnvironment of currentContext.
|
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.
|
||||||
4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
are the same.
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
5. Assert: environment and originalEnv are the same.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
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.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
@ -33,5 +25,5 @@ var probe1, probe2;
|
|||||||
) {}
|
) {}
|
||||||
}.m());
|
}.m());
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'outside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'inside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
|
@ -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);
|
|
@ -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);
|
|
@ -2,25 +2,23 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: If a computed property key contains a direct eval call, a new declarative environment is created.
|
description: >
|
||||||
|
sloppy direct evals in params introduce vars
|
||||||
info: |
|
info: |
|
||||||
Runtime Semantics: IteratorBindingInitialization
|
[...]
|
||||||
|
20. Else,
|
||||||
FormalParameter : BindingElement
|
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).
|
||||||
2. Let currentContext be the running execution context.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
3. Let originalEnv be the VariableEnvironment of currentContext.
|
[...]
|
||||||
4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext are the same.
|
flags: [noStrict]
|
||||||
5. Assert: environment and originalEnv are the same.
|
|
||||||
6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv).
|
|
||||||
...
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var x = "outer";
|
var x = "outer";
|
||||||
|
|
||||||
function evalInComputedPropertyKey({[eval("var x = 'inner'")]: ignored}) {
|
function evalInComputedPropertyKey({[eval("var x = 'inner'")]: ignored}) {
|
||||||
assert.sameValue(x, "outer");
|
assert.sameValue(x, "inner");
|
||||||
}
|
}
|
||||||
evalInComputedPropertyKey({});
|
evalInComputedPropertyKey({});
|
||||||
|
@ -2,25 +2,23 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: If a property initializer contains a direct eval call, a new declarative environment is created.
|
description: >
|
||||||
|
sloppy direct evals in params introduce vars
|
||||||
info: |
|
info: |
|
||||||
Runtime Semantics: IteratorBindingInitialization
|
[...]
|
||||||
|
20. Else,
|
||||||
FormalParameter : BindingElement
|
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).
|
||||||
2. Let currentContext be the running execution context.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
3. Let originalEnv be the VariableEnvironment of currentContext.
|
[...]
|
||||||
4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext are the same.
|
flags: [noStrict]
|
||||||
5. Assert: environment and originalEnv are the same.
|
|
||||||
6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv).
|
|
||||||
...
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var x = "outer";
|
var x = "outer";
|
||||||
|
|
||||||
function evalInPropertyInitializer({a: ignored = eval("var x = 'inner'")}) {
|
function evalInPropertyInitializer({a: ignored = eval("var x = 'inner'")}) {
|
||||||
assert.sameValue(x, "outer");
|
assert.sameValue(x, "inner");
|
||||||
}
|
}
|
||||||
evalInPropertyInitializer({});
|
evalInPropertyInitializer({});
|
||||||
|
@ -17,9 +17,7 @@ info: |
|
|||||||
|
|
||||||
14.1.19 Runtime Semantics: IteratorBindingInitialization
|
14.1.19 Runtime Semantics: IteratorBindingInitialization
|
||||||
`FunctionRestParameter : BindingRestElement`
|
`FunctionRestParameter : BindingRestElement`
|
||||||
...
|
1. Let result be IteratorBindingInitialization of BindingRestElement with arguments iteratorRecord and environment.
|
||||||
9. Let result be the result of performing IteratorBindingInitialization for BindingRestElement using iteratorRecord and environment as the arguments.
|
|
||||||
...
|
|
||||||
|
|
||||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
`BindingRestElement : ...BindingIdentifier`
|
`BindingRestElement : ...BindingIdentifier`
|
||||||
|
@ -1,18 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Removal of variable environment for each BindingElement formal parameter
|
sloppy direct evals in params introduce vars
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv).
|
20. Else,
|
||||||
7. Set the VariableEnvironment of currentContext to paramVarEnv.
|
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.
|
||||||
8. Set the LexicalEnvironment of currentContext to paramVarEnv.
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
9. Let result be the result of performing IteratorBindingInitialization for
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
BindingElement using iteratorRecord and environment as the arguments.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
10. Set the VariableEnvironment of currentContext to originalEnv.
|
|
||||||
11. Set the LexicalEnvironment of currentContext to originalEnv.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
@ -29,5 +27,5 @@ function f(
|
|||||||
f();
|
f();
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'inside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'outside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
assert.sameValue(probeBody(), 'outside');
|
assert.sameValue(probeBody(), 'inside');
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Creation of new variable environment for each BindingElement formal
|
sloppy direct evals in params introduce vars
|
||||||
parameter
|
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv).
|
20. Else,
|
||||||
7. Set the VariableEnvironment of currentContext to paramVarEnv.
|
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.
|
||||||
8. Set the LexicalEnvironment of currentContext to paramVarEnv.
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
9. Let result be the result of performing IteratorBindingInitialization for
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
BindingElement using iteratorRecord and environment as the arguments.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
10. Set the VariableEnvironment of currentContext to originalEnv.
|
|
||||||
11. Set the LexicalEnvironment of currentContext to originalEnv.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
@ -28,5 +25,5 @@ function f(
|
|||||||
}
|
}
|
||||||
f();
|
f();
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'outside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'inside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
|
@ -1,24 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Removal of variable environment for the BindingRestElement formal parameter
|
sloppy direct evals in params introduce vars
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
2. Let currentContext be the running execution context.
|
20. Else,
|
||||||
3. Let originalEnv be the VariableEnvironment of currentContext.
|
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.
|
||||||
4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
are the same.
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
5. Assert: environment and originalEnv are the same.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
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.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
@ -34,4 +26,4 @@ function f(
|
|||||||
f();
|
f();
|
||||||
|
|
||||||
assert.sameValue(probeParam(), 'inside');
|
assert.sameValue(probeParam(), 'inside');
|
||||||
assert.sameValue(probeBody(), 'outside');
|
assert.sameValue(probeBody(), 'inside');
|
||||||
|
@ -1,24 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Creation of new variable environment for the BindingRestElement formal
|
sloppy direct evals in params introduce vars
|
||||||
parameter
|
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
2. Let currentContext be the running execution context.
|
20. Else,
|
||||||
3. Let originalEnv be the VariableEnvironment of currentContext.
|
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.
|
||||||
4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
are the same.
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
5. Assert: environment and originalEnv are the same.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
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.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
@ -33,5 +25,5 @@ function f(
|
|||||||
}
|
}
|
||||||
f();
|
f();
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'outside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'inside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
|
@ -1,18 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Removal of variable environment for each BindingElement formal parameter
|
sloppy direct evals in params introduce vars
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv).
|
20. Else,
|
||||||
7. Set the VariableEnvironment of currentContext to paramVarEnv.
|
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.
|
||||||
8. Set the LexicalEnvironment of currentContext to paramVarEnv.
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
9. Let result be the result of performing IteratorBindingInitialization for
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
BindingElement using iteratorRecord and environment as the arguments.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
10. Set the VariableEnvironment of currentContext to originalEnv.
|
|
||||||
11. Set the LexicalEnvironment of currentContext to originalEnv.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
features: [generators]
|
features: [generators]
|
||||||
@ -30,5 +28,5 @@ function* g(
|
|||||||
g().next();
|
g().next();
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'inside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'outside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
assert.sameValue(probeBody(), 'outside');
|
assert.sameValue(probeBody(), 'inside');
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Creation of new variable environment for each BindingElement formal
|
sloppy direct evals in params introduce vars
|
||||||
parameter
|
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
6. Let paramVarEnv be NewDeclarativeEnvironment(originalEnv).
|
20. Else,
|
||||||
7. Set the VariableEnvironment of currentContext to paramVarEnv.
|
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.
|
||||||
8. Set the LexicalEnvironment of currentContext to paramVarEnv.
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
9. Let result be the result of performing IteratorBindingInitialization for
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
BindingElement using iteratorRecord and environment as the arguments.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
10. Set the VariableEnvironment of currentContext to originalEnv.
|
|
||||||
11. Set the LexicalEnvironment of currentContext to originalEnv.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
features: [generators]
|
features: [generators]
|
||||||
@ -29,5 +26,5 @@ function* g(
|
|||||||
}
|
}
|
||||||
g().next();
|
g().next();
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'outside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'inside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
|
@ -1,24 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Removal of variable environment for the BindingRestElement formal parameter
|
sloppy direct evals in params introduce vars
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
2. Let currentContext be the running execution context.
|
20. Else,
|
||||||
3. Let originalEnv be the VariableEnvironment of currentContext.
|
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.
|
||||||
4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
are the same.
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
5. Assert: environment and originalEnv are the same.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
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.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
features: [generators]
|
features: [generators]
|
||||||
@ -35,4 +27,4 @@ function* g(
|
|||||||
g().next();
|
g().next();
|
||||||
|
|
||||||
assert.sameValue(probeParam(), 'inside');
|
assert.sameValue(probeParam(), 'inside');
|
||||||
assert.sameValue(probeBody(), 'outside');
|
assert.sameValue(probeBody(), 'inside');
|
||||||
|
@ -1,24 +1,16 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-function-definitions-runtime-semantics-iteratorbindinginitialization
|
esid: sec-functiondeclarationinstantiation
|
||||||
description: >
|
description: >
|
||||||
Creation of new variable environment for the BindingRestElement formal
|
sloppy direct evals in params introduce vars
|
||||||
parameter
|
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
2. Let currentContext be the running execution context.
|
20. Else,
|
||||||
3. Let originalEnv be the VariableEnvironment of currentContext.
|
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.
|
||||||
4. Assert: The VariableEnvironment and LexicalEnvironment of currentContext
|
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
|
||||||
are the same.
|
c. Let env be NewDeclarativeEnvironment(calleeEnv).
|
||||||
5. Assert: environment and originalEnv are the same.
|
d. Let envRec be env's EnvironmentRecord.
|
||||||
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.
|
|
||||||
[...]
|
[...]
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
features: [generators]
|
features: [generators]
|
||||||
@ -34,5 +26,5 @@ function* g(
|
|||||||
}
|
}
|
||||||
g().next();
|
g().next();
|
||||||
|
|
||||||
assert.sameValue(probe1(), 'outside');
|
assert.sameValue(probe1(), 'inside');
|
||||||
assert.sameValue(probe2(), 'inside');
|
assert.sameValue(probe2(), 'inside');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user