Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/class/fields-wrapped-in-sc-computed-names.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/class-fields/computed-names.case
3 // - src/class-fields/productions/cls-expr-wrapped-in-sc.template
4 /*---
5 description: Computed property names (fields definition wrapped in semicolons)
6 esid: prod-FieldDefinition
7 features: [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 = "b";
23
24
25
26 var C = class {
27 ;;;;
28 ;;;;;;[x] = 42; [10] = "meep"; ["not initialized"];;;;;;;
29 ;;;;
30
31 }
32
33 var c = new C();
34
35 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
36 assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
37
38 verifyProperty(c, "b", {
39 value: 42,
40 enumerable: true,
41 writable: true,
42 configurable: true
43 });
44
45 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
46 assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
47 assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
48
49 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "10"), false);
50 assert.sameValue(Object.hasOwnProperty.call(C, "10"), false);
51
52 verifyProperty(c, "10", {
53 value: "meep",
54 enumerable: true,
55 writable: true,
56 configurable: true
57 });
58
59 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false);
60 assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false);
61
62 verifyProperty(c, "not initialized", {
63 value: undefined,
64 enumerable: true,
65 writable: true,
66 configurable: true
67 });