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.
4 esid: sec-globaldeclarationinstantiation
6 description: Lexical declarations "shadow" configurable global properties
9 5. For each name in lexNames, do
11 c. Let hasRestrictedGlobal be ? envRec.HasRestrictedGlobalProperty(name).
12 d. If hasRestrictedGlobal is true, throw a SyntaxError exception.
14 16. For each element d in lexDeclarations do
15 a. NOTE Lexically declared names are only instantiated here but not
17 b. For each element dn of the BoundNames of d do
18 i. If IsConstantDeclaration of d is true, then
19 1. Perform ? envRec.CreateImmutableBinding(dn, true).
21 1. Perform ? envRec.CreateMutableBinding(dn, false).
26 assert.sameValue(Array, undefined);
27 assert.sameValue(typeof this.Array, 'function');
29 // DO NOT USE propertyHelper API!
30 let descriptor = Object.getOwnPropertyDescriptor(this, 'Array');
31 assert.sameValue(descriptor.configurable, true);
32 assert.sameValue(descriptor.enumerable, false);
33 assert.sameValue(descriptor.writable, true);