Debian Codegraph @

js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/class-elements/rs-static-privatename-identifier-initializer-alt.case
3 // - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
4 /*---
5 description: Valid Static PrivateName (field definitions after a static generator in the same line)
6 esid: prod-FieldDefinition
7 features: [class-static-fields-private, generators, 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 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 var C = class {
60 static *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
61 static $() {
62 return this.#$;
63 }
64 static _() {
65 return this.#_;
66 }
67 static \u{6F}() {
68 return this.#\u{6F};
69 }
70 static ℘() {
71 return this.#℘;
72 }
73 static ZW_‌_NJ() {
74 return this.#ZW_‌_NJ;
75 }
76 static ZW_‍_J() {
77 return this.#ZW_‍_J;
78 }
79 }
80
81 var c = new C();
82
83 assert.sameValue(C.m().next().value, 42);
84 assert(
85 !Object.prototype.hasOwnProperty.call(c, "m"),
86 "m doesn't appear as an own property on the C instance"
87 );
88 assert(
89 !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
90 "m doesn't appear as an own property on the C prototype"
91 );
92
93 verifyProperty(C, "m", {
94 enumerable: false,
95 configurable: true,
96 writable: true,
97 });
98
99 assert.sameValue(C.$(), 1);
100 assert.sameValue(C._(), 1);
101 assert.sameValue(C.\u{6F}(), 1);
102 assert.sameValue(C.℘(), 1);
103 assert.sameValue(C.ZW_‌_NJ(), 1);
104 assert.sameValue(C.ZW_‍_J(), 1);
105
106
107 reportCompare(0, 0);