Debian Codegraph @

js/src/tests/test262/language/module-code/instn-named-bndng-dflt-cls.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 Imported binding reflects state of exported default binding ("anonymous"
7 class declaration)
8 esid: sec-moduledeclarationinstantiation
9 info: |
10 [...]
11 17. For each element d in lexDeclarations do
12 a. For each element dn of the BoundNames of d do
13 i. If IsConstantDeclaration of d is true, then
14 [...]
15 ii. Else,
16 1. Perform ! envRec.CreateMutableBinding(dn, false).
17 iii. If d is a GeneratorDeclaration production or a
18 FunctionDeclaration production, then
19 1. Let fo be the result of performing InstantiateFunctionObject
20 for d with argument env.
21 2. Call envRec.InitializeBinding(dn, fo).
22 [...]
23
24 14.5 Class Definitions
25
26 Syntax
27
28 ClassDeclaration[Yield, Default]:
29
30 class BindingIdentifier[?Yield] ClassTail[?Yield]
31 [+Default] class ClassTail[?Yield]
32 flags: [module]
33 ---*/
34
35 assert.throws(ReferenceError, function() {
36 typeof C;
37 }, 'Binding is created but not initialized.');
38
39 export default class {};
40 import C from './instn-named-bndng-dflt-cls.js';
41
42 reportCompare(0, 0);