Debian Codegraph @

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