var-env-var-init-global-new.js (1025B)
1 // Copyright (C) 2016 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 esid: sec-evaldeclarationinstantiation 5 description: Initialization of new global property 6 info: | 7 [...] 8 16. For each String vn in declaredVarNames, in list order do 9 a. If varEnvRec is a global Environment Record, then 10 i. Perform ? varEnvRec.CreateGlobalVarBinding(vn, true). 11 [...] 12 13 8.1.1.4.17 CreateGlobalVarBinding 14 15 [...] 16 5. Let extensible be ? IsExtensible(globalObject). 17 6. If hasProperty is false and extensible is true, then 18 a. Perform ? ObjRec.CreateMutableBinding(N, D). 19 b. Perform ? ObjRec.InitializeBinding(N, undefined). 20 [...] 21 flags: [noStrict] 22 includes: [propertyHelper.js] 23 ---*/ 24 25 var initial = null; 26 27 eval('initial = x; var x;'); 28 29 verifyProperty(this, 'x', { 30 value: undefined, 31 writable: true, 32 enumerable: true, 33 configurable: true, 34 }); 35 36 assert.sameValue(initial, undefined); 37 38 reportCompare(0, 0);