Debian Codegraph @

js/src/tests/test262/language/statements/class/cpn-class-decl-fields-methods-computed-property-name-from-await-expression.js

raw
1 // |reftest| module async
2 // This file was procedurally generated from the following sources:
3 // - src/computed-property-names/computed-property-name-from-await-expression.case
4 // - src/computed-property-names/evaluation/class-declaration-fields-methods.template
5 /*---
6 description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
7 esid: prod-ComputedPropertyName
8 features: [computed-property-names, top-level-await, class-fields-public, class-static-fields-public]
9 flags: [generated, async, module]
10 info: |
11 ClassExpression:
12 classBindingIdentifier opt ClassTail
13
14 ClassTail:
15 ClassHeritage opt { ClassBody opt }
16
17 ClassBody:
18 ClassElementList
19
20 ClassElementList:
21 ClassElement
22
23 ClassElement:
24 MethodDefinition
25
26 MethodDefinition:
27 PropertyName ...
28 get PropertyName ...
29 set PropertyName ...
30
31 PropertyName:
32 ComputedPropertyName
33
34 ComputedPropertyName:
35 [ AssignmentExpression ]
36 ---*/
37 try {
38
39
40 let C = class {
41 [await 9] = () => {
42 return 9;
43 };
44
45 static [await 9] = () => {
46 return 9;
47 };
48 };
49
50 let c = new C();
51
52 assert.sameValue(
53 c[await 9](),
54 9
55 );
56 assert.sameValue(
57 C[await 9](),
58 9
59 );
60 assert.sameValue(
61 c[String(await 9)](),
62 9
63 );
64 assert.sameValue(
65 C[String(await 9)](),
66 9
67 );
68
69 } catch (e) {
70 $DONE(e);
71 }
72 $DONE();