Debian Codegraph @

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

raw
1 // This file was procedurally generated from the following sources:
2 // - src/class-elements/rs-static-generator-method-privatename-identifier.case
3 // - src/class-elements/productions/cls-decl-multiple-stacked-definitions.template
4 /*---
5 description: Valid Static GeneratorMethod PrivateName (multiple stacked fields definitions through ASI)
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 class C {
63 static * #$(value) {
64 yield * value;
65 }
66 static * #_(value) {
67 yield * value;
68 }
69 static * #\u{6F}(value) {
70 yield * value;
71 }
72 static * #\u2118(value) {
73 yield * value;
74 }
75 static * #ZW_\u200C_NJ(value) {
76 yield * value;
77 }
78 static * #ZW_\u200D_J(value) {
79 yield * value;
80 }
81 foo = "foobar"
82 bar = "barbaz";
83 static get $() {
84 return this.#$;
85 }
86 static get _() {
87 return this.#_;
88 }
89 static get \u{6F}() {
90 return this.#\u{6F};
91 }
92 static get \u2118() {
93 return this.#\u2118;
94 }
95 static get ZW_\u200C_NJ() {
96 return this.#ZW_\u200C_NJ;
97 }
98 static get ZW_\u200D_J() {
99 return this.#ZW_\u200D_J;
100 }
101
102 }
103
104 var c = new C();
105
106 assert.sameValue(c.foo, "foobar");
107 assert(
108 !Object.prototype.hasOwnProperty.call(C, "foo"),
109 "foo doesn't appear as an own property on the C constructor"
110 );
111 assert(
112 !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
113 "foo doesn't appear as an own property on the C prototype"
114 );
115
116 verifyProperty(c, "foo", {
117 value: "foobar",
118 enumerable: true,
119 configurable: true,
120 writable: true,
121 });
122
123 assert.sameValue(c.bar, "barbaz");
124 assert(
125 !Object.prototype.hasOwnProperty.call(C, "bar"),
126 "bar doesn't appear as an own property on the C constructor"
127 );
128 assert(
129 !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
130 "bar doesn't appear as an own property on the C prototype"
131 );
132
133 verifyProperty(c, "bar", {
134 value: "barbaz",
135 enumerable: true,
136 configurable: true,
137 writable: true,
138 });
139
140 assert.sameValue(C.$([1]).next().value, 1);
141 assert.sameValue(C._([1]).next().value, 1);
142 assert.sameValue(C.\u{6F}([1]).next().value, 1);
143 assert.sameValue(C.\u2118([1]).next().value, 1);
144 assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1);
145 assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1);
146
147
148 reportCompare(0, 0);