mirror of
				https://github.com/tc39/test262.git
				synced 2025-11-04 05:33:50 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			936 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			936 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
// Copyright (C) 2015 André Bargull. All rights reserved.
 | 
						|
// 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.
 | 
						|
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).
 | 
						|
  ...
 | 
						|
---*/
 | 
						|
 | 
						|
var x = "outer";
 | 
						|
 | 
						|
function evalInComputedPropertyKey({[eval("var x = 'inner'")]: ignored}) {
 | 
						|
  assert.sameValue(x, "outer");
 | 
						|
}
 | 
						|
evalInComputedPropertyKey({});
 |