Debian Codegraph @

js/src/tests/test262/language/statements/class/static-init-invalid-lex-var.js

raw
1 // |reftest| error:SyntaxError
2 // Copyright (C) 2021 the V8 project authors. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 esid: sec-class-definitions-static-semantics-early-errors
6 description: Block cannot declare a lexically-scoped binding and function-scoped binding with the same name.
7 info: |
8 ClassStaticBlockBody : ClassStaticBlockStatementList
9
10 - It is a Syntax Error if any element of the LexicallyDeclaredNames of
11 ClassStaticBlockStatementList also occurs in the VarDeclaredNames of
12 ClassStaticBlockStatementList.
13 negative:
14 phase: parse
15 type: SyntaxError
16 features: [class-static-block]
17 ---*/
18
19 $DONOTEVALUATE();
20
21 class C {
22 static {
23 let x;
24 var x;
25 }
26 }