cpn-class-expr-accessors-computed-property-name-from-integer-separators.js (1811B)
1 // This file was procedurally generated from the following sources: 2 // - src/computed-property-names/computed-property-name-from-integer-separators.case 3 // - src/computed-property-names/evaluation/class-expression-accessors.template 4 /*--- 5 description: Computed property name from integer with separators (ComputedPropertyName in ClassExpression) 6 esid: prod-ComputedPropertyName 7 features: [computed-property-names] 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 get [1_2_3_4_5_6_7_8]() { 40 return 1_2_3_4_5_6_7_8; 41 } 42 43 set [1_2_3_4_5_6_7_8](v) { 44 return 1_2_3_4_5_6_7_8; 45 } 46 47 static get [1_2_3_4_5_6_7_8]() { 48 return 1_2_3_4_5_6_7_8; 49 } 50 51 static set [1_2_3_4_5_6_7_8](v) { 52 return 1_2_3_4_5_6_7_8; 53 } 54 }; 55 56 let c = new C(); 57 58 assert.sameValue( 59 c[1_2_3_4_5_6_7_8], 60 1_2_3_4_5_6_7_8 61 ); 62 assert.sameValue( 63 c[1_2_3_4_5_6_7_8] = 1_2_3_4_5_6_7_8, 64 1_2_3_4_5_6_7_8 65 ); 66 67 assert.sameValue( 68 C[1_2_3_4_5_6_7_8], 69 1_2_3_4_5_6_7_8 70 ); 71 assert.sameValue( 72 C[1_2_3_4_5_6_7_8] = 1_2_3_4_5_6_7_8, 73 1_2_3_4_5_6_7_8 74 ); 75 assert.sameValue( 76 c[String(1_2_3_4_5_6_7_8)], 77 1_2_3_4_5_6_7_8 78 ); 79 assert.sameValue( 80 c[String(1_2_3_4_5_6_7_8)] = 1_2_3_4_5_6_7_8, 81 1_2_3_4_5_6_7_8 82 ); 83 84 assert.sameValue( 85 C[String(1_2_3_4_5_6_7_8)], 86 1_2_3_4_5_6_7_8 87 ); 88 assert.sameValue( 89 C[String(1_2_3_4_5_6_7_8)] = 1_2_3_4_5_6_7_8, 90 1_2_3_4_5_6_7_8 91 ); 92 93 reportCompare(0, 0);