Debian Codegraph @

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