Debian Codegraph @

js/src/tests/test262/language/expressions/object/method-definition/static-init-await-reference-accessor.js

raw
1 // Copyright (C) 2021 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-class-definitions-static-semantics-early-errors
5 description: The `await` keyword is interpreted as an identifier within accessor methods
6 info: |
7 ClassStaticBlockBody : ClassStaticBlockStatementList
8
9 [...]
10 - It is a Syntax Error if ContainsAwait of ClassStaticBlockStatementList is true.
11 features: [class-static-block]
12 ---*/
13
14 var await = 0;
15 var fromParam, fromBody;
16
17 class C {
18 static {
19 ({
20 set accessor(x = fromParam = await) {
21 fromBody = await;
22 }
23 }).accessor = undefined;
24 }
25 }
26
27 assert.sameValue(fromParam, 0, 'from parameter');
28 assert.sameValue(fromBody, 0, 'from body');
29
30 reportCompare(0, 0);