Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/class/fields-same-line-async-method-literal-names.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/class-fields/literal-names.case
3 // - src/class-fields/productions/cls-expr-after-same-line-async-method.template
4 /*---
5 description: Literal property names (field definitions after an async method in the same line)
6 esid: prod-FieldDefinition
7 features: [class, class-fields-public, async-functions]
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 const fn = function() {}
23
24
25
26 var C = class {
27 async m() { return 42; } a; b = 42;
28 c = fn;
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, "a"), false);
44 assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
45
46 verifyProperty(c, "a", {
47 value: undefined,
48 enumerable: true,
49 writable: true,
50 configurable: true
51 });
52
53 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
54 assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
55
56 verifyProperty(c, "b", {
57 value: 42,
58 enumerable: true,
59 writable: true,
60 configurable: true
61 });
62
63 assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false);
64 assert.sameValue(Object.hasOwnProperty.call(C, "c"), false);
65
66 verifyProperty(c, "c", {
67 value: fn,
68 enumerable: true,
69 writable: true,
70 configurable: true
71 });
72
73
74 c.m().then(function(v) {
75 assert.sameValue(v, 42);
76 }, $DONE).then($DONE, $DONE);