Debian Codegraph @

js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-field-identifier-initializer.js

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