Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/class/fields-wrapped-in-sc-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-wrapped-in-sc.template
4 /*---
5 description: Computed property symbol names (fields definition wrapped in semicolons)
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 ;;;;
29 ;;;;;;[x]; [y] = 42;;;;;;;
30 ;;;;
31
32 }
33
34 var c = new C();
35
36 assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false);
37 assert.sameValue(Object.hasOwnProperty.call(C, x), false);
38
39 verifyProperty(c, x, {
40 value: undefined,
41 enumerable: true,
42 writable: true,
43 configurable: true
44 });
45
46 assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
47 assert.sameValue(Object.hasOwnProperty.call(C, y), false);
48
49 verifyProperty(c, y, {
50 value: 42,
51 enumerable: true,
52 writable: true,
53 configurable: true
54 });
55
56 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
57 assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
58 assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
59
60 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
61 assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
62 assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);