same-line-async-gen-rs-private-setter.js (3230B)
1 // |reftest| async 2 // This file was procedurally generated from the following sources: 3 // - src/class-elements/rs-private-setter.case 4 // - src/class-elements/productions/cls-expr-after-same-line-async-gen.template 5 /*--- 6 description: Valid PrivateName as private setter (field definitions after an 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 set ClassElementName ( PropertySetParameterList ) { FunctionBody } 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 async *m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_; 60 set #$(value) { 61 this.#$_ = value; 62 } 63 set #_(value) { 64 this.#__ = value; 65 } 66 set #\u{6F}(value) { 67 this.#\u{6F}_ = value; 68 } 69 set #\u2118(value) { 70 this.#\u2118_ = value; 71 } 72 set #ZW_\u200C_NJ(value) { 73 this.#ZW_\u200C_NJ_ = value; 74 } 75 set #ZW_\u200D_J(value) { 76 this.#ZW_\u200D_J_ = value; 77 } 78 ; 79 $(value) { 80 this.#$ = value; 81 return this.#$_; 82 } 83 _(value) { 84 this.#_ = value; 85 return this.#__; 86 } 87 \u{6F}(value) { 88 this.#\u{6F} = value; 89 return this.#\u{6F}_; 90 } 91 \u2118(value) { 92 this.#\u2118 = value; 93 return this.#\u2118_; 94 } 95 ZW_\u200C_NJ(value) { 96 this.#ZW_\u200C_NJ = value; 97 return this.#ZW_\u200C_NJ_; 98 } 99 ZW_\u200D_J(value) { 100 this.#ZW_\u200D_J = value; 101 return this.#ZW_\u200D_J_; 102 } 103 104 } 105 106 var c = new C(); 107 108 assert( 109 !Object.prototype.hasOwnProperty.call(c, "m"), 110 "m doesn't appear as an own property on the C instance" 111 ); 112 assert.sameValue(c.m, C.prototype.m); 113 114 verifyProperty(C.prototype, "m", { 115 enumerable: false, 116 configurable: true, 117 writable: true, 118 }, {restore: true}); 119 120 c.m().next().then(function(v) { 121 assert.sameValue(v.value, 42); 122 assert.sameValue(v.done, true); 123 124 function assertions() { 125 // Cover $DONE handler for async cases. 126 function $DONE(error) { 127 if (error) { 128 throw new Test262Error('Test262:AsyncTestFailure') 129 } 130 } 131 assert.sameValue(c.$(1), 1); 132 assert.sameValue(c._(1), 1); 133 assert.sameValue(c.\u{6F}(1), 1); 134 assert.sameValue(c.\u2118(1), 1); 135 assert.sameValue(c.ZW_\u200C_NJ(1), 1); 136 assert.sameValue(c.ZW_\u200D_J(1), 1); 137 } 138 139 return Promise.resolve(assertions()); 140 }).then($DONE, $DONE);