Debian Codegraph @

js/src/tests/test262/language/module-code/instn-local-bndng-export-const.js

raw
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 Binding is created but not initialized for exported `const` statements
7 esid: sec-moduledeclarationinstantiation
8 info: |
9 [...]
10 17. For each element d in lexDeclarations do
11 a. For each element dn of the BoundNames of d do
12 i. If IsConstantDeclaration of d is true, then
13 [...]
14 ii. Else,
15 1. Perform ! envRec.CreateMutableBinding(dn, false).
16 [...]
17 includes: [fnGlobalObject.js]
18 flags: [module]
19 ---*/
20
21 var global = fnGlobalObject();
22
23 assert.throws(ReferenceError, function() {
24 typeof test262;
25 }, 'Binding is created but not initialized.');
26 assert.sameValue(
27 Object.getOwnPropertyDescriptor(global, 'test262'), undefined
28 );
29
30 export const test262 = 23;
31
32 reportCompare(0, 0);