summaryrefslogtreecommitdiff
path: root/src/class-fields/productions/cls-expr-after-same-line-static-async-method.template
blob: 84dad392800e4586516e39f80acd3e5bf0fb9a95 (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
31
32
33
// 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/expressions/class/fields-after-same-line-static-async-method-
name: field definitions after a static async method in the same line
features: [class, class-fields-public, async-functions]
flags: [async]
esid: prod-FieldDefinition
includes: [propertyHelper.js]
---*/

var C = class {
  static async m() { return 42; } /*{ fields }*/;
/*{ privateinspectionfunctions }*/
}

var c = new C();

assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false);

verifyProperty(C, "m", {
  enumerable: false,
  configurable: true,
  writable: true,
}, {restore: true});

/*{ assertions }*/

C.m().then(function(v) {
  assert.sameValue(v, 42);
}, $DONE).then($DONE, $DONE);