Debian Codegraph @

js/src/tests/test262/language/statements/class/static-init-invalid-await.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
6 description: The "Await" parsing context does not apply to the block's statement list
7 info: |
8 Syntax
9
10 [...]
11
12 ClassStaticBlockStatementList :
13 StatementList[~Yield, +Await, ~Return]opt
14
15 ## 15.7.1 Static Semantics: Early Errors
16
17 ClassStaticBlockBody : ClassStaticBlockStatementList
18
19 - It is a Syntax Error if ContainsAwait of ClassStaticBlockStatementList is true.
20 negative:
21 phase: parse
22 type: SyntaxError
23 features: [class-static-block]
24 ---*/
25
26 $DONOTEVALUATE();
27
28 async function f() {
29 class C {
30 static {
31 await 0;
32 }
33 }
34 }