Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/class/fields-same-line-async-gen-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-after-same-line-async-gen.template
4 /*---
5 description: Computed property symbol names (field definitions after an async generator in the same line)
6 esid: prod-FieldDefinition
7 features: [Symbol, computed-property-names, class, class-fields-public, async-iteration]
8 flags: [generated, async]
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 async *m() { return 42; } [x]; [y] = 42;
29
30 }
31
32 var c = new C();
33
34 assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
35 assert.sameValue(c.m, C.prototype.m);
36
37 verifyProperty(C.prototype, "m", {
38 enumerable: false,
39 configurable: true,
40 writable: true,
41 }, {restore: true});
42
43 assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false);
44 assert.sameValue(Object.hasOwnProperty.call(C, x), false);
45
46 verifyProperty(c, x, {
47 value: undefined,
48 enumerable: true,
49 writable: true,
50 configurable: true
51 });
52
53 assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false);
54 assert.sameValue(Object.hasOwnProperty.call(C, y), false);
55
56 verifyProperty(c, y, {
57 value: 42,
58 enumerable: true,
59 writable: true,
60 configurable: true
61 });
62
63 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false);
64 assert.sameValue(Object.hasOwnProperty.call(C, "x"), false);
65 assert.sameValue(Object.hasOwnProperty.call(c, "x"), false);
66
67 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false);
68 assert.sameValue(Object.hasOwnProperty.call(C, "y"), false);
69 assert.sameValue(Object.hasOwnProperty.call(c, "y"), false);
70
71 c.m().next().then(function(v) {
72 assert.sameValue(v.value, 42);
73 assert.sameValue(v.done, true);
74 }, $DONE).then($DONE, $DONE);