Debian Codegraph @

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

raw
1 // This file was procedurally generated from the following sources:
2 // - src/class-elements/rs-privatename-identifier-initializer.case
3 // - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
4 /*---
5 description: Valid PrivateName (field definitions after a static generator in the same line)
6 esid: prod-FieldDefinition
7 features: [class-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 ;
16
17 FieldDefinition :
18 ClassElementName Initializer _opt
19
20 ClassElementName :
21 PropertyName
22 PrivateName
23
24 PrivateName ::
25 # IdentifierName
26
27 IdentifierName ::
28 IdentifierStart
29 IdentifierName IdentifierPart
30
31 IdentifierStart ::
32 UnicodeIDStart
33 $
34 _
35 \ UnicodeEscapeSequence
36
37 IdentifierPart::
38 UnicodeIDContinue
39 $
40 \ UnicodeEscapeSequence
41 <ZWNJ> <ZWJ>
42
43 UnicodeIDStart::
44 any Unicode code point with the Unicode property "ID_Start"
45
46 UnicodeIDContinue::
47 any Unicode code point with the Unicode property "ID_Continue"
48
49
50 NOTE 3
51 The sets of code points with Unicode properties "ID_Start" and
52 "ID_Continue" include, respectively, the code points with Unicode
53 properties "Other_ID_Start" and "Other_ID_Continue".
54
55 ---*/
56
57
58 var C = class {
59 static *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1;
60 $() {
61 return this.#$;
62 }
63 _() {
64 return this.#_;
65 }
66 \u{6F}() {
67 return this.#\u{6F};
68 }
69 \u2118() {
70 return this.#\u2118;
71 }
72 ZW_\u200C_NJ() {
73 return this.#ZW_\u200C_NJ;
74 }
75 ZW_\u200D_J() {
76 return this.#ZW_\u200D_J;
77 }
78 }
79
80 var c = new C();
81
82 assert.sameValue(C.m().next().value, 42);
83 assert(
84 !Object.prototype.hasOwnProperty.call(c, "m"),
85 "m doesn't appear as an own property on the C instance"
86 );
87 assert(
88 !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
89 "m doesn't appear as an own property on the C prototype"
90 );
91
92 verifyProperty(C, "m", {
93 enumerable: false,
94 configurable: true,
95 writable: true,
96 });
97
98 assert.sameValue(c.$(), 1);
99 assert.sameValue(c._(), 1);
100 assert.sameValue(c.\u{6F}(), 1);
101 assert.sameValue(c.\u2118(), 1);
102 assert.sameValue(c.ZW_\u200C_NJ(), 1);
103 assert.sameValue(c.ZW_\u200D_J(), 1);
104
105
106 reportCompare(0, 0);