Debian Codegraph @

js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js

raw
1 // |reftest| async
2 // This file was procedurally generated from the following sources:
3 // - src/class-elements/rs-static-async-generator-method-privatename-identifier-alt.case
4 // - src/class-elements/productions/cls-expr-multiple-definitions.template
5 /*---
6 description: Valid Static AsyncGeneratorMethod PrivateName (multiple fields definitions)
7 esid: prod-FieldDefinition
8 features: [class-static-methods-private, class, class-fields-public]
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 MethodDefinition :
20 AsyncGeneratorMethod
21
22 AsyncGeneratorMethod :
23 async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
24
25 ClassElementName :
26 PropertyName
27 PrivateName
28
29 PrivateName ::
30 # IdentifierName
31
32 IdentifierName ::
33 IdentifierStart
34 IdentifierName IdentifierPart
35
36 IdentifierStart ::
37 UnicodeIDStart
38 $
39 _
40 \ UnicodeEscapeSequence
41
42 IdentifierPart::
43 UnicodeIDContinue
44 $
45 \ UnicodeEscapeSequence
46 <ZWNJ> <ZWJ>
47
48 UnicodeIDStart::
49 any Unicode code point with the Unicode property "ID_Start"
50
51 UnicodeIDContinue::
52 any Unicode code point with the Unicode property "ID_Continue"
53
54
55 NOTE 3
56 The sets of code points with Unicode properties "ID_Start" and
57 "ID_Continue" include, respectively, the code points with Unicode
58 properties "Other_ID_Start" and "Other_ID_Continue".
59
60 ---*/
61
62
63 var C = class {
64 foo = "foobar";
65 m() { return 42 }
66 static async * #$(value) {
67 yield * await value;
68 }
69 static async * #_(value) {
70 yield * await value;
71 }
72 static async * #o(value) {
73 yield * await value;
74 }
75 static async * #℘(value) {
76 yield * await value;
77 }
78 static async * #ZW_‌_NJ(value) {
79 yield * await value;
80 }
81 static async * #ZW_‍_J(value) {
82 yield * await value;
83 }
84 m2() { return 39 }
85 bar = "barbaz";
86 static get $() {
87 return this.#$;
88 }
89 static get _() {
90 return this.#_;
91 }
92 static get o() {
93 return this.#o;
94 }
95 static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
96 return this.#℘;
97 }
98 static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
99 return this.#ZW_‌_NJ;
100 }
101 static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
102 return this.#ZW_‍_J;
103 }
104
105 }
106
107 var c = new C();
108
109 assert.sameValue(c.m(), 42);
110 assert(
111 !Object.prototype.hasOwnProperty.call(c, "m"),
112 "m doesn't appear as an own property on the C instance"
113 );
114 assert.sameValue(c.m, C.prototype.m);
115
116 verifyProperty(C.prototype, "m", {
117 enumerable: false,
118 configurable: true,
119 writable: true,
120 });
121
122 assert.sameValue(c.m2(), 39);
123 assert(
124 !Object.prototype.hasOwnProperty.call(c, "m2"),
125 "m2 doesn't appear as an own property on the C instance"
126 );
127 assert.sameValue(c.m2, C.prototype.m2);
128
129 verifyProperty(C.prototype, "m2", {
130 enumerable: false,
131 configurable: true,
132 writable: true,
133 });
134
135 assert.sameValue(c.foo, "foobar");
136 assert(
137 !Object.prototype.hasOwnProperty.call(C, "foo"),
138 "foo doesn't appear as an own property on the C constructor"
139 );
140 assert(
141 !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
142 "foo doesn't appear as an own property on the C prototype"
143 );
144
145 verifyProperty(c, "foo", {
146 value: "foobar",
147 enumerable: true,
148 configurable: true,
149 writable: true,
150 });
151
152 assert.sameValue(c.bar, "barbaz");
153 assert(
154 !Object.prototype.hasOwnProperty.call(C, "bar"),
155 "bar doesn't appear as an own property on the C constructor"
156 );
157 assert(
158 !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
159 "bar doesn't appear as an own property on the C prototype"
160 );
161
162 verifyProperty(c, "bar", {
163 value: "barbaz",
164 enumerable: true,
165 configurable: true,
166 writable: true,
167 });
168
169 Promise.all([
170 C.$([1]).next(),
171 C._([1]).next(),
172 C.o([1]).next(),
173 C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
174 C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
175 C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
176 ]).then(results => {
177
178 assert.sameValue(results[0].value, 1);
179 assert.sameValue(results[1].value, 1);
180 assert.sameValue(results[2].value, 1);
181 assert.sameValue(results[3].value, 1);
182 assert.sameValue(results[4].value, 1);
183 assert.sameValue(results[5].value, 1);
184
185 }).then($DONE, $DONE);