Debian Codegraph @

js/src/tests/test262/language/eval-code/indirect/lex-env-no-init-cls.js

raw
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-performeval
5 description: >
6 Indirect eval code creates `class` bindings prior to evaluation, but does
7 not initialize them.
8 info: |
9 [...]
10 14. For each element d in lexDeclarations do
11 a. NOTE Lexically declared names are only instantiated here but not
12 initialized.
13 b. For each element dn of the BoundNames of d do
14 i. If IsConstantDeclaration of d is true, then
15 1. Perform ? lexEnvRec.CreateImmutableBinding(dn, true).
16 ii. Else,
17 2. Perform ? lexEnvRec.CreateMutableBinding(dn, false).
18 [...]
19 features: [class]
20 ---*/
21
22 assert.throws(ReferenceError, function() {
23 (0,eval)('typeof C; class C {}');
24 });
25
26 reportCompare(0, 0);