instn-local-bndng-for.js (1323B)
1 // |reftest| module 2 // Copyright (C) 2016 the V8 project authors. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 /*--- 5 description: > 6 Mutable bindings are initialized in the lexical environment record prior to 7 execution for variable declarations within `for` statements 8 esid: sec-moduledeclarationinstantiation 9 info: | 10 [...] 11 13. Let varDeclarations be the VarScopedDeclarations of code. 12 14. Let declaredVarNames be a new empty List. 13 15. For each element d in varDeclarations do 14 a. For each element dn of the BoundNames of d do 15 i. If dn is not an element of declaredVarNames, then 16 1. Perform ! envRec.CreateMutableBinding(dn, false). 17 2. Call envRec.InitializeBinding(dn, undefined). 18 [...] 19 includes: [fnGlobalObject.js] 20 flags: [module] 21 ---*/ 22 23 var global = fnGlobalObject(); 24 25 assert.sameValue(test262, undefined, 'value is initialized to `undefined`'); 26 assert.sameValue( 27 Object.getOwnPropertyDescriptor(global, 'test262'), undefined 28 ); 29 30 for (var test262 = null; false; ) {} 31 32 assert.sameValue(test262, null, 'binding is mutable'); 33 assert.sameValue( 34 Object.getOwnPropertyDescriptor(global, 'test262'), 35 undefined, 36 'global binding is not effected by evaluation of declaration' 37 ); 38 39 reportCompare(0, 0);