wrapped-in-sc-string-literal-names.js (2078B)
1 // This file was procedurally generated from the following sources: 2 // - src/class-elements/string-literal-names.case 3 // - src/class-elements/productions/cls-expr-wrapped-in-sc.template 4 /*--- 5 description: String literal names (fields definition wrapped in semicolons) 6 esid: prod-FieldDefinition 7 features: [class-fields-public, class] 8 flags: [generated] 9 includes: [propertyHelper.js] 10 info: | 11 ClassElement: 12 ... 13 FieldDefinition ; 14 15 FieldDefinition: 16 ClassElementName Initializer_opt 17 18 ClassElementName: 19 PropertyName 20 21 ---*/ 22 23 24 var C = class { 25 ;;;; 26 ;;;;;;'a'; "b"; 'c' = 39; 27 "d" = 42;;;;;;; 28 ;;;; 29 30 } 31 32 var c = new C(); 33 34 assert( 35 !Object.prototype.hasOwnProperty.call(C.prototype, "a"), 36 "a does not appear as an own property on C prototype" 37 ); 38 assert( 39 !Object.prototype.hasOwnProperty.call(C, "a"), 40 "a does not appear as an own property on C constructor" 41 ); 42 43 verifyProperty(c, "a", { 44 value: undefined, 45 enumerable: true, 46 writable: true, 47 configurable: true 48 }); 49 50 assert( 51 !Object.prototype.hasOwnProperty.call(C.prototype, "b"), 52 "b does not appear as an own property on C prototype" 53 ); 54 assert( 55 !Object.prototype.hasOwnProperty.call(C, "b"), 56 "b does not appear as an own property on C constructor" 57 ); 58 59 verifyProperty(c, "b", { 60 value: undefined, 61 enumerable: true, 62 writable: true, 63 configurable: true 64 }); 65 66 assert( 67 !Object.prototype.hasOwnProperty.call(C.prototype, "c"), 68 "c does not appear as an own property on C prototype" 69 ); 70 assert( 71 !Object.prototype.hasOwnProperty.call(C, "c"), 72 "c does not appear as an own property on C constructor" 73 ); 74 75 verifyProperty(c, "c", { 76 value: 39, 77 enumerable: true, 78 writable: true, 79 configurable: true 80 }); 81 82 assert( 83 !Object.prototype.hasOwnProperty.call(C.prototype, "d"), 84 "d does not appear as an own property on C prototype" 85 ); 86 assert( 87 !Object.prototype.hasOwnProperty.call(C, "d"), 88 "d does not appear as an own property on C constructor" 89 ); 90 91 verifyProperty(c, "d", { 92 value: 42, 93 enumerable: true, 94 writable: true, 95 configurable: true 96 }); 97 98 reportCompare(0, 0);