js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js
raw symbols SCIP| 1 | // |reftest| async |
| 2 | // This file was procedurally generated from the following sources: |
| 3 | // - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case |
| 4 | // - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template |
| 5 | /*--- |
| 6 | description: Valid Static PrivateName (field definitions after a static async method in the same line) |
| 7 | esid: prod-FieldDefinition |
| 8 | features: [class-static-fields-private, class, class-fields-public, async-functions] |
| 9 | flags: [generated, async] |
| 10 | includes: [propertyHelper.js] |
| 11 | info: | |
| 12 | ClassElement : |
| 13 | MethodDefinition |
| 14 | static MethodDefinition |
| 15 | FieldDefinition ; |
| 16 | static FieldDefinition ; |
| 17 | ; |
| 18 | |
| 19 | FieldDefinition : |
| 20 | ClassElementName Initializer _opt |
| 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 | |
| 52 | NOTE 3 |
| 53 | The sets of code points with Unicode properties "ID_Start" and |
| 54 | "ID_Continue" include, respectively, the code points with Unicode |
| 55 | properties "Other_ID_Start" and "Other_ID_Continue". |
| 56 | |
| 57 | ---*/ |
| 58 | |
| 59 | |
| 60 | var C = class { |
| 61 | static async m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW__NJ; static #ZW__J; |
| 62 | static $(value) { |
| 63 | C.#$ = value; |
| 64 | return C.#$; |
| 65 | } |
| 66 | static _(value) { |
| 67 | C.#_ = value; |
| 68 | return C.#_; |
| 69 | } |
| 70 | static o(value) { |
| 71 | C.#\u{6F} = value; |
| 72 | return C.#\u{6F}; |
| 73 | } |
| 74 | static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD |
| 75 | C.#℘ = value; |
| 76 | return C.#℘; |
| 77 | } |
| 78 | static ZW__NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD |
| 79 | C.#ZW__NJ = value; |
| 80 | return C.#ZW__NJ; |
| 81 | } |
| 82 | static ZW__J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD |
| 83 | C.#ZW__J = value; |
| 84 | return C.#ZW__J; |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | var c = new C(); |
| 89 | |
| 90 | assert( |
| 91 | !Object.prototype.hasOwnProperty.call(c, "m"), |
| 92 | "m doesn't appear as an own property on the C instance" |
| 93 | ); |
| 94 | assert( |
| 95 | !Object.prototype.hasOwnProperty.call(C.prototype, "m"), |
| 96 | "m doesn't appear as an own property on the C prototype" |
| 97 | ); |
| 98 | |
| 99 | verifyProperty(C, "m", { |
| 100 | enumerable: false, |
| 101 | configurable: true, |
| 102 | writable: true, |
| 103 | }, {restore: true}); |
| 104 | |
| 105 | C.m().then(function(v) { |
| 106 | assert.sameValue(v, 42); |
| 107 | |
| 108 | function assertions() { |
| 109 | // Cover $DONE handler for async cases. |
| 110 | function $DONE(error) { |
| 111 | if (error) { |
| 112 | throw new Test262Error('Test262:AsyncTestFailure') |
| 113 | } |
| 114 | } |
| 115 | assert.sameValue(C.$(1), 1); |
| 116 | assert.sameValue(C._(1), 1); |
| 117 | assert.sameValue(C.o(1), 1); |
| 118 | assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD |
| 119 | assert.sameValue(C.ZW__NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD |
| 120 | assert.sameValue(C.ZW__J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD |
| 121 | |
| 122 | } |
| 123 | |
| 124 | return Promise.resolve(assertions()); |
| 125 | }).then($DONE, $DONE); |