cpn-class-expr-computed-property-name-from-await-expression.js (1278B)
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-expression.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] 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 static [await 9]() { 45 return 9; 46 } 47 }; 48 49 let c = new C(); 50 51 assert.sameValue( 52 c[await 9](), 53 9 54 ); 55 assert.sameValue( 56 C[await 9](), 57 9 58 ); 59 assert.sameValue( 60 c[String(await 9)](), 61 9 62 ); 63 assert.sameValue( 64 C[String(await 9)](), 65 9 66 ); 67 68 } catch (e) { 69 $DONE(e); 70 } 71 $DONE();