Debian Codegraph @

js/src/tests/test262/language/statements/class/elements/new-sc-line-gen-rs-static-privatename-identifier-initializer.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/class-elements/rs-static-privatename-identifier-initializer.case
3 // - src/class-elements/productions/cls-decl-new-sc-line-generator.template
4 /*---
5 description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon)
6 esid: prod-FieldDefinition
7 features: [class-static-fields-private, class, class-fields-public, generators]
8 flags: [generated]
9 includes: [propertyHelper.js]
10 info: |
11 ClassElement :
12 MethodDefinition
13 static MethodDefinition
14 FieldDefinition ;
15 static 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
58
59 class C {
60 static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1;
61 *m() { return 42; }
62 static $() {
63 return this.#$;
64 }
65 static _() {
66 return this.#_;
67 }
68 static \u{6F}() {
69 return this.#\u{6F};
70 }
71 static \u2118() {
72 return this.#\u2118;
73 }
74 static ZW_\u200C_NJ() {
75 return this.#ZW_\u200C_NJ;
76 }
77 static ZW_\u200D_J() {
78 return this.#ZW_\u200D_J;
79 }
80 }
81
82 var c = new C();
83
84 assert.sameValue(c.m().next().value, 42);
85 assert.sameValue(c.m, C.prototype.m);
86 assert(
87 !Object.prototype.hasOwnProperty.call(c, "m"),
88 "m doesn't appear as an own property on the C instance"
89 );
90
91 verifyProperty(C.prototype, "m", {
92 enumerable: false,
93 configurable: true,
94 writable: true,
95 });
96
97 assert.sameValue(C.$(), 1);
98 assert.sameValue(C._(), 1);
99 assert.sameValue(C.\u{6F}(), 1);
100 assert.sameValue(C.\u2118(), 1);
101 assert.sameValue(C.ZW_\u200C_NJ(), 1);
102 assert.sameValue(C.ZW_\u200D_J(), 1);
103
104
105 reportCompare(0, 0);