Debian Codegraph @

js/src/tests/test262/language/statements/class/elements/after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js

raw
1 // |reftest| async
2 // This file was procedurally generated from the following sources:
3 // - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
4 // - src/class-elements/productions/cls-decl-after-same-line-static-async-gen.template
5 /*---
6 description: PrivateName Static Semantics, StringValue (field definitions after a static async generator in the same line)
7 esid: prod-FieldDefinition
8 features: [class-fields-private, class, class-fields-public, async-iteration]
9 flags: [generated, async]
10 includes: [propertyHelper.js]
11 info: |
12 ClassElement :
13 MethodDefinition
14 static MethodDefinition
15 FieldDefinition ;
16 ;
17
18 FieldDefinition :
19 ClassElementName Initializer _opt
20
21 ClassElementName :
22 PropertyName
23 PrivateName
24
25 PrivateName ::
26 # IdentifierName
27
28 IdentifierName ::
29 IdentifierStart
30 IdentifierName IdentifierPart
31
32 IdentifierStart ::
33 UnicodeIDStart
34 $
35 _
36 \ UnicodeEscapeSequence
37
38 IdentifierPart::
39 UnicodeIDContinue
40 $
41 \ UnicodeEscapeSequence
42 <ZWNJ> <ZWJ>
43
44 UnicodeIDStart::
45 any Unicode code point with the Unicode property "ID_Start"
46
47 UnicodeIDContinue::
48 any Unicode code point with the Unicode property "ID_Continue"
49
50
51 NOTE 3
52 The sets of code points with Unicode properties "ID_Start" and
53 "ID_Continue" include, respectively, the code points with Unicode
54 properties "Other_ID_Start" and "Other_ID_Continue".
55
56
57 1. Return the String value consisting of the sequence of code
58 units corresponding to PrivateName. In determining the sequence
59 any occurrences of \ UnicodeEscapeSequence are first replaced
60 with the code point represented by the UnicodeEscapeSequence
61 and then the code points of the entire PrivateName are converted
62 to code units by UTF16Encoding (10.1.1) each code point.
63
64 ---*/
65
66
67 class C {
68 static async *m() { return 42; } #\u{6F};
69 #\u2118;
70 #ZW_\u200C_NJ;
71 #ZW_\u200D_J;;
72 o(value) {
73 this.#o = value;
74 return this.#o;
75 }
76 ℘(value) {
77 this.#℘ = value;
78 return this.#℘;
79 }
80 ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
81 this.#ZW_‌_NJ = value;
82 return this.#ZW_‌_NJ;
83 }
84 ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
85 this.#ZW_‍_J = value;
86 return this.#ZW_‍_J;
87 }
88 }
89
90 var c = new C();
91
92 assert(
93 !Object.prototype.hasOwnProperty.call(c, "m"),
94 "m doesn't appear as an own property on the C instance"
95 );
96 assert(
97 !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
98 "m doesn't appear as an own property on the C prototype"
99 );
100
101 verifyProperty(C, "m", {
102 enumerable: false,
103 configurable: true,
104 writable: true,
105 }, {restore: true});
106
107 C.m().next().then(function(v) {
108 assert.sameValue(v.value, 42);
109 assert.sameValue(v.done, true);
110
111 function assertions() {
112 // Cover $DONE handler for async cases.
113 function $DONE(error) {
114 if (error) {
115 throw new Test262Error('Test262:AsyncTestFailure')
116 }
117 }
118 assert.sameValue(c.o(1), 1);
119 assert.sameValue(c.℘(1), 1);
120 assert.sameValue(c.ZW_‌_NJ(1), 1);
121 assert.sameValue(c.ZW_‍_J(1), 1);
122 }
123
124 return Promise.resolve(assertions());
125 }).then($DONE, $DONE);