decl-var.js (1510B)
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-globaldeclarationinstantiation 5 es6id: 15.1.8 6 description: Declaration of variable where permissible 7 info: | 8 [...] 9 11. Let declaredVarNames be a new empty List. 10 12. For each d in varDeclarations, do 11 a. If d is a VariableDeclaration or a ForBinding, then 12 i. For each String vn in the BoundNames of d, do 13 1. If vn is not an element of declaredFunctionNames, then 14 a. Let vnDefinable be ? envRec.CanDeclareGlobalVar(vn). 15 b. If vnDefinable is false, throw a TypeError exception. 16 c. If vn is not an element of declaredVarNames, then 17 i. Append vn to declaredVarNames. 18 [...] 19 18. For each String vn in declaredVarNames, in list order do 20 a. Perform ? envRec.CreateGlobalVarBinding(vn, false). 21 [...] 22 23 8.1.1.4.15 CanDeclareGlobalVar 24 25 1. Let envRec be the global Environment Record for which the method was 26 invoked. 27 2. Let ObjRec be envRec.[[ObjectRecord]]. 28 3. Let globalObject be the binding object for ObjRec. 29 4. Let hasProperty be ? HasOwnProperty(globalObject, N). 30 5. If hasProperty is true, return true. 31 6. Return ? IsExtensible(globalObject). 32 includes: [propertyHelper.js] 33 ---*/ 34 35 verifyProperty(this, "brandNew", { 36 value: undefined, 37 writable: true, 38 enumerable: true, 39 configurable: false, 40 }); 41 42 var brandNew; 43 44 reportCompare(0, 0);