Debian Codegraph @

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

raw
1 // This file was procedurally generated from the following sources:
2 // - src/class-fields/computed-symbol-names.case
3 // - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template
4 /*---
5 description: Computed property symbol names (multiple stacked fields definitions through ASI)
6 esid: prod-FieldDefinition
7 features: [Symbol, computed-property-names, 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 var x = Symbol();
23 var y = Symbol();
24
25
26
27 var C = class {
28 [x]; [y] = 42
29 foo = "foobar"
30 bar = "barbaz";
31
32 }
33
34 var c = new C();
35
36 assert.sameValue(c.foo, "foobar");
37 assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false);
38 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false);
39
40 verifyProperty(c, "foo", {
41 value: "foobar",
42 enumerable: true,
43 configurable: true,
44 writable: true,
45 });
46
47 assert.sameValue(c.bar, "barbaz");
48 assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false);
49 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false);
50
51 verifyProperty(c, "bar", {
52 value: "barbaz",
53 enumerable: true,
54 configurable: true,
55 writable: true,
56 });
57
58 assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false);
59 assert.sameValue(Object.hasOwnProperty.call(C, x), false);
60
61 verifyProperty(c, x, {
62 value: undefined,
63 enumerable: true,
64 writable: true,
65 configurable: true
66 });
67
68 assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
69 assert.sameValue(Object.hasOwnProperty.call(C, y), false);
70
71 verifyProperty(c, y, {
72 value: 42,
73 enumerable: true,
74 writable: true,
75 configurable: true
76 });
77
78 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
79 assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
80 assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
81
82 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
83 assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
84 assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);