blob: a261640ddfbc52335108f37f4f8b314d963ac070 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
// Copyright (C) 2017 the V8 project authors, 2017 Igalia S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/statements/class/fields-same-line-async-method-
name: field definitions after an async method in the same line
features: [class-fields, async-functions]
flags: [async]
---*/
class C {
async m() { return 42; } /*{ fields }*/;
}
var c = new C();
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
assert.sameValue(c.m, C.prototype.m);
verifyProperty(C.prototype, "m", {
enumerable: false,
configurable: true,
writable: true,
});
/*{ assertions }*/
c.m().then(function(v) {
assert.sameValue(v, 42);
}, $DONE).then($DONE, $DONE);
|