Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/class/fields-multiple-stacked-definitions-string-literal-names.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/class-fields/string-literal-names.case
3 // - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template
4 /*---
5 description: String literal names (multiple stacked fields definitions through ASI)
6 esid: prod-FieldDefinition
7 features: [class, class-fields-public]
8 flags: [generated]
9 includes: [propertyHelper.js]
10 info: |
11 ClassElement:
12 ...
13 FieldDefinition ;
14
15 FieldDefinition:
16 ClassElementName Initializer_opt
17
18 ClassElementName:
19 PropertyName
20
21 ---*/
22
23
24 var C = class {
25 'a'; "b"; 'c' = 39;
26 "d" = 42
27 foo = "foobar"
28 bar = "barbaz";
29
30 }
31
32 var c = new C();
33
34 assert.sameValue(c.foo, "foobar");
35 assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false);
36 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false);
37
38 verifyProperty(c, "foo", {
39 value: "foobar",
40 enumerable: true,
41 configurable: true,
42 writable: true,
43 });
44
45 assert.sameValue(c.bar, "barbaz");
46 assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false);
47 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false);
48
49 verifyProperty(c, "bar", {
50 value: "barbaz",
51 enumerable: true,
52 configurable: true,
53 writable: true,
54 });
55
56 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
57 assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
58
59 verifyProperty(c, "a", {
60 value: undefined,
61 enumerable: true,
62 writable: true,
63 configurable: true
64 });
65
66 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
67 assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
68
69 verifyProperty(c, "b", {
70 value: undefined,
71 enumerable: true,
72 writable: true,
73 configurable: true
74 });
75
76 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false);
77 assert.sameValue(Object.hasOwnProperty.call(C, "c"), false);
78
79 verifyProperty(c, "c", {
80 value: 39,
81 enumerable: true,
82 writable: true,
83 configurable: true
84 });
85
86 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false);
87 assert.sameValue(Object.hasOwnProperty.call(C, "d"), false);
88
89 verifyProperty(c, "d", {
90 value: 42,
91 enumerable: true,
92 writable: true,
93 configurable: true
94 });