Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / language / module-code / instn-named-bndng-dflt-cls.js
blob92711a9254c04b6bff9dd7b1188b002bdc7e2acd
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     [...]
24     14.5 Class Definitions
26     Syntax
28     ClassDeclaration[Yield, Default]:
30         class BindingIdentifier[?Yield] ClassTail[?Yield]
31         [+Default] class ClassTail[?Yield]
32 flags: [module]
33 ---*/
35 assert.throws(ReferenceError, function() {
36   typeof C;
37 }, 'Binding is created but not initialized.');
39 export default class {};
40 import C from './instn-named-bndng-dflt-cls.js';
42 reportCompare(0, 0);