Debian Codegraph @

js/src/tests/test262/language/statements/class/elements/new-sc-line-method-rs-static-async-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-method-privatename-identifier.case
4 // - src/class-elements/productions/cls-decl-new-sc-line-method.template
5 /*---
6 description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line with a semicolon)
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 AsyncMethod
21
22 AsyncMethod :
23 async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
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 return await value;
66 }
67 static async #_(value) {
68 return await value;
69 }
70 static async #\u{6F}(value) {
71 return await value;
72 }
73 static async #\u2118(value) {
74 return await value;
75 }
76 static async #ZW_\u200C_NJ(value) {
77 return await value;
78 }
79 static async #ZW_\u200D_J(value) {
80 return await value;
81 };
82 m() { return 42; }
83 static async $(value) {
84 return await this.#$(value);
85 }
86 static async _(value) {
87 return await this.#_(value);
88 }
89 static async \u{6F}(value) {
90 return await this.#\u{6F}(value);
91 }
92 static async \u2118(value) {
93 return await this.#\u2118(value);
94 }
95 static async ZW_\u200C_NJ(value) {
96 return await this.#ZW_\u200C_NJ(value);
97 }
98 static async ZW_\u200D_J(value) {
99 return await this.#ZW_\u200D_J(value);
100 }
101
102 }
103
104 var c = new C();
105
106 assert.sameValue(c.m(), 42);
107 assert.sameValue(c.m, C.prototype.m);
108 assert(
109 !Object.prototype.hasOwnProperty.call(c, "m"),
110 "m doesn't appear as an own property on the C instance"
111 );
112
113 verifyProperty(C.prototype, "m", {
114 enumerable: false,
115 configurable: true,
116 writable: true,
117 });
118
119 Promise.all([
120 C.$(1),
121 C._(1),
122 C.\u{6F}(1),
123 C.\u2118(1),
124 C.ZW_\u200C_NJ(1),
125 C.ZW_\u200D_J(1),
126 ]).then(results => {
127
128 assert.sameValue(results[0], 1);
129 assert.sameValue(results[1], 1);
130 assert.sameValue(results[2], 1);
131 assert.sameValue(results[3], 1);
132 assert.sameValue(results[4], 1);
133 assert.sameValue(results[5], 1);
134
135 }).then($DONE, $DONE);
136