Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / language / global-code / decl-lex-configurable-global.js
blobfd457b542b2d0f3cfbc9fbca8f3de06ad4cf1719
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: Lexical declarations "shadow" configurable global properties
7 info: |
8   [...]
9   5. For each name in lexNames, do
10      [...]
11      c. Let hasRestrictedGlobal be ? envRec.HasRestrictedGlobalProperty(name).
12      d. If hasRestrictedGlobal is true, throw a SyntaxError exception.
13   [...]
14   16. For each element d in lexDeclarations do
15       a. NOTE Lexically declared names are only instantiated here but not
16          initialized.
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).
20          ii. Else,
21              1. Perform ? envRec.CreateMutableBinding(dn, false).
22 ---*/
24 let Array;
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);
35 reportCompare(0, 0);