cpn-class-expr-fields-computed-property-name-from-math.js (1333B)
1 // This file was procedurally generated from the following sources: 2 // - src/computed-property-names/computed-property-name-from-math.case 3 // - src/computed-property-names/evaluation/class-expression-fields.template 4 /*--- 5 description: Computed property name from math (ComputedPropertyName in ClassExpression) 6 esid: prod-ComputedPropertyName 7 features: [computed-property-names, exponentiation, class-fields-public, class-static-fields-public] 8 flags: [generated] 9 info: | 10 ClassExpression: 11 classBindingIdentifier opt ClassTail 12 13 ClassTail: 14 ClassHeritage opt { ClassBody opt } 15 16 ClassBody: 17 ClassElementList 18 19 ClassElementList: 20 ClassElement 21 22 ClassElement: 23 MethodDefinition 24 25 MethodDefinition: 26 PropertyName ... 27 get PropertyName ... 28 set PropertyName ... 29 30 PropertyName: 31 ComputedPropertyName 32 33 ComputedPropertyName: 34 [ AssignmentExpression ] 35 ---*/ 36 37 38 let C = class { 39 [1 + 2 - 3 * 4 / 5 ** 6] = 2.999232; 40 41 static [1 + 2 - 3 * 4 / 5 ** 6] = 2.999232; 42 }; 43 44 let c = new C(); 45 46 assert.sameValue( 47 c[1 + 2 - 3 * 4 / 5 ** 6], 48 2.999232 49 ); 50 assert.sameValue( 51 C[1 + 2 - 3 * 4 / 5 ** 6], 52 2.999232 53 ); 54 assert.sameValue( 55 c[String(1 + 2 - 3 * 4 / 5 ** 6)], 56 2.999232 57 ); 58 assert.sameValue( 59 C[String(1 + 2 - 3 * 4 / 5 ** 6)], 60 2.999232 61 ); 62 63 reportCompare(0, 0);