Debian Codegraph @

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

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