regular-definitions-rs-private-getter-alt.js (2337B)
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-decl-regular-definitions.template 4 /*--- 5 description: Valid PrivateName as private getter (regular fields defintion) 6 esid: prod-FieldDefinition 7 features: [class-methods-private, class-fields-private, class, class-fields-public] 8 flags: [generated] 9 info: | 10 ClassElement : 11 MethodDefinition 12 ... 13 ; 14 15 MethodDefinition : 16 ... 17 get ClassElementName ( ){ FunctionBody } 18 ... 19 20 ClassElementName : 21 PropertyName 22 PrivateName 23 24 PrivateName :: 25 # IdentifierName 26 27 IdentifierName :: 28 IdentifierStart 29 IdentifierName IdentifierPart 30 31 IdentifierStart :: 32 UnicodeIDStart 33 $ 34 _ 35 \ UnicodeEscapeSequence 36 37 IdentifierPart:: 38 UnicodeIDContinue 39 $ 40 \ UnicodeEscapeSequence 41 <ZWNJ> <ZWJ> 42 43 UnicodeIDStart:: 44 any Unicode code point with the Unicode property "ID_Start" 45 46 UnicodeIDContinue:: 47 any Unicode code point with the Unicode property "ID_Continue" 48 49 NOTE 3 50 The sets of code points with Unicode properties "ID_Start" and 51 "ID_Continue" include, respectively, the code points with Unicode 52 properties "Other_ID_Start" and "Other_ID_Continue". 53 54 ---*/ 55 56 57 class C { 58 #$_; #__; #\u{6F}_; #℘_; #ZW__NJ_; #ZW__J_; 59 get #$() { 60 return this.#$_; 61 } 62 get #_() { 63 return this.#__; 64 } 65 get #\u{6F}() { 66 return this.#\u{6F}_; 67 } 68 get #℘() { 69 return this.#℘_; 70 } 71 get #ZW__NJ() { 72 return this.#ZW__NJ_; 73 } 74 get #ZW__J() { 75 return this.#ZW__J_; 76 } 77 78 $(value) { 79 this.#$_ = value; 80 return this.#$; 81 } 82 _(value) { 83 this.#__ = value; 84 return this.#_; 85 } 86 \u{6F}(value) { 87 this.#\u{6F}_ = value; 88 return this.#\u{6F}; 89 } 90 ℘(value) { 91 this.#℘_ = value; 92 return this.#℘; 93 } 94 ZW__NJ(value) { 95 this.#ZW__NJ_ = value; 96 return this.#ZW__NJ; 97 } 98 ZW__J(value) { 99 this.#ZW__J_ = value; 100 return this.#ZW__J; 101 } 102 103 } 104 105 var c = new C(); 106 107 assert.sameValue(c.$(1), 1); 108 assert.sameValue(c._(1), 1); 109 assert.sameValue(c.\u{6F}(1), 1); 110 assert.sameValue(c.℘(1), 1); 111 assert.sameValue(c.ZW__NJ(1), 1); 112 assert.sameValue(c.ZW__J(1), 1); 113 114 reportCompare(0, 0);