new-sc-line-method-rs-private-getter-alt.js (2726B)
1 // This file was procedurally generated from the following sources: 2 // - src/class-elements/rs-private-getter-alt.case 3 // - src/class-elements/productions/cls-expr-new-sc-line-method.template 4 /*--- 5 description: Valid PrivateName as private getter (field definitions followed by a method in a new line with a semicolon) 6 esid: prod-FieldDefinition 7 features: [class-methods-private, class-fields-private, class, class-fields-public] 8 flags: [generated] 9 includes: [propertyHelper.js] 10 info: | 11 ClassElement : 12 MethodDefinition 13 ... 14 ; 15 16 MethodDefinition : 17 ... 18 get ClassElementName ( ){ FunctionBody } 19 ... 20 21 ClassElementName : 22 PropertyName 23 PrivateName 24 25 PrivateName :: 26 # IdentifierName 27 28 IdentifierName :: 29 IdentifierStart 30 IdentifierName IdentifierPart 31 32 IdentifierStart :: 33 UnicodeIDStart 34 $ 35 _ 36 \ UnicodeEscapeSequence 37 38 IdentifierPart:: 39 UnicodeIDContinue 40 $ 41 \ UnicodeEscapeSequence 42 <ZWNJ> <ZWJ> 43 44 UnicodeIDStart:: 45 any Unicode code point with the Unicode property "ID_Start" 46 47 UnicodeIDContinue:: 48 any Unicode code point with the Unicode property "ID_Continue" 49 50 NOTE 3 51 The sets of code points with Unicode properties "ID_Start" and 52 "ID_Continue" include, respectively, the code points with Unicode 53 properties "Other_ID_Start" and "Other_ID_Continue". 54 55 ---*/ 56 57 58 var C = class { 59 #$_; #__; #\u{6F}_; #℘_; #ZW__NJ_; #ZW__J_; 60 get #$() { 61 return this.#$_; 62 } 63 get #_() { 64 return this.#__; 65 } 66 get #\u{6F}() { 67 return this.#\u{6F}_; 68 } 69 get #℘() { 70 return this.#℘_; 71 } 72 get #ZW__NJ() { 73 return this.#ZW__NJ_; 74 } 75 get #ZW__J() { 76 return this.#ZW__J_; 77 } 78 ; 79 m() { return 42; } 80 $(value) { 81 this.#$_ = value; 82 return this.#$; 83 } 84 _(value) { 85 this.#__ = value; 86 return this.#_; 87 } 88 \u{6F}(value) { 89 this.#\u{6F}_ = value; 90 return this.#\u{6F}; 91 } 92 ℘(value) { 93 this.#℘_ = value; 94 return this.#℘; 95 } 96 ZW__NJ(value) { 97 this.#ZW__NJ_ = value; 98 return this.#ZW__NJ; 99 } 100 ZW__J(value) { 101 this.#ZW__J_ = value; 102 return this.#ZW__J; 103 } 104 105 } 106 107 var c = new C(); 108 109 assert.sameValue(c.m(), 42); 110 assert.sameValue(c.m, C.prototype.m); 111 assert( 112 !Object.prototype.hasOwnProperty.call(c, "m"), 113 "m doesn't appear as an own property on the C instance" 114 ); 115 116 verifyProperty(C.prototype, "m", { 117 enumerable: false, 118 configurable: true, 119 writable: true, 120 }); 121 122 assert.sameValue(c.$(1), 1); 123 assert.sameValue(c._(1), 1); 124 assert.sameValue(c.\u{6F}(1), 1); 125 assert.sameValue(c.℘(1), 1); 126 assert.sameValue(c.ZW__NJ(1), 1); 127 assert.sameValue(c.ZW__J(1), 1); 128 129 reportCompare(0, 0);