after-same-line-static-async-gen-rs-private-getter-alt.js (3220B)
1 // |reftest| async 2 // This file was procedurally generated from the following sources: 3 // - src/class-elements/rs-private-getter-alt.case 4 // - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template 5 /*--- 6 description: Valid PrivateName as private getter (field definitions after a static async generator in the same line) 7 esid: prod-FieldDefinition 8 features: [class-methods-private, class-fields-private, class, class-fields-public, async-iteration] 9 flags: [generated, async] 10 includes: [propertyHelper.js] 11 info: | 12 ClassElement : 13 MethodDefinition 14 ... 15 ; 16 17 MethodDefinition : 18 ... 19 get ClassElementName ( ){ FunctionBody } 20 ... 21 22 ClassElementName : 23 PropertyName 24 PrivateName 25 26 PrivateName :: 27 # IdentifierName 28 29 IdentifierName :: 30 IdentifierStart 31 IdentifierName IdentifierPart 32 33 IdentifierStart :: 34 UnicodeIDStart 35 $ 36 _ 37 \ UnicodeEscapeSequence 38 39 IdentifierPart:: 40 UnicodeIDContinue 41 $ 42 \ UnicodeEscapeSequence 43 <ZWNJ> <ZWJ> 44 45 UnicodeIDStart:: 46 any Unicode code point with the Unicode property "ID_Start" 47 48 UnicodeIDContinue:: 49 any Unicode code point with the Unicode property "ID_Continue" 50 51 NOTE 3 52 The sets of code points with Unicode properties "ID_Start" and 53 "ID_Continue" include, respectively, the code points with Unicode 54 properties "Other_ID_Start" and "Other_ID_Continue". 55 56 ---*/ 57 58 59 var C = class { 60 static async *m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW__NJ_; #ZW__J_; 61 get #$() { 62 return this.#$_; 63 } 64 get #_() { 65 return this.#__; 66 } 67 get #\u{6F}() { 68 return this.#\u{6F}_; 69 } 70 get #℘() { 71 return this.#℘_; 72 } 73 get #ZW__NJ() { 74 return this.#ZW__NJ_; 75 } 76 get #ZW__J() { 77 return this.#ZW__J_; 78 } 79 ; 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( 110 !Object.prototype.hasOwnProperty.call(c, "m"), 111 "m doesn't appear as an own property on the C instance" 112 ); 113 assert( 114 !Object.prototype.hasOwnProperty.call(C.prototype, "m"), 115 "m doesn't appear as an own property on the C prototype" 116 ); 117 118 verifyProperty(C, "m", { 119 enumerable: false, 120 configurable: true, 121 writable: true, 122 }, {restore: true}); 123 124 C.m().next().then(function(v) { 125 assert.sameValue(v.value, 42); 126 assert.sameValue(v.done, true); 127 128 function assertions() { 129 // Cover $DONE handler for async cases. 130 function $DONE(error) { 131 if (error) { 132 throw new Test262Error('Test262:AsyncTestFailure') 133 } 134 } 135 assert.sameValue(c.$(1), 1); 136 assert.sameValue(c._(1), 1); 137 assert.sameValue(c.\u{6F}(1), 1); 138 assert.sameValue(c.℘(1), 1); 139 assert.sameValue(c.ZW__NJ(1), 1); 140 assert.sameValue(c.ZW__J(1), 1); 141 } 142 143 return Promise.resolve(assertions()); 144 }).then($DONE, $DONE);