after-same-line-static-async-method-rs-private-getter.js (3225B)
1 // |reftest| async 2 // This file was procedurally generated from the following sources: 3 // - src/class-elements/rs-private-getter.case 4 // - src/class-elements/productions/cls-decl-after-same-line-static-async-method.template 5 /*--- 6 description: Valid PrivateName as private getter (field definitions after a static async method in the same line) 7 esid: prod-FieldDefinition 8 features: [class-methods-private, class-fields-private, class, class-fields-public, async-functions] 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 class C { 60 static async m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_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 #\u2118() { 71 return this.#\u2118_; 72 } 73 get #ZW_\u200C_NJ() { 74 return this.#ZW_\u200C_NJ_; 75 } 76 get #ZW_\u200D_J() { 77 return this.#ZW_\u200D_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 \u2118(value) { 93 this.#\u2118_ = value; 94 return this.#\u2118; 95 } 96 ZW_\u200C_NJ(value) { 97 this.#ZW_\u200C_NJ_ = value; 98 return this.#ZW_\u200C_NJ; 99 } 100 ZW_\u200D_J(value) { 101 this.#ZW_\u200D_J_ = value; 102 return this.#ZW_\u200D_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().then(function(v) { 125 assert.sameValue(v, 42); 126 127 function assertions() { 128 // Cover $DONE handler for async cases. 129 function $DONE(error) { 130 if (error) { 131 throw new Test262Error('Test262:AsyncTestFailure') 132 } 133 } 134 assert.sameValue(c.$(1), 1); 135 assert.sameValue(c._(1), 1); 136 assert.sameValue(c.\u{6F}(1), 1); 137 assert.sameValue(c.\u2118(1), 1); 138 assert.sameValue(c.ZW_\u200C_NJ(1), 1); 139 assert.sameValue(c.ZW_\u200D_J(1), 1); 140 } 141 142 return Promise.resolve(assertions()); 143 }).then($DONE, $DONE);