summaryrefslogtreecommitdiff
path: root/src/class-fields/default/cls-decl-after-same-line-static-method.template
blob: 5b828cc60007b4e8cb5d17c572fbb415e8c67119 (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
// 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-after-same-line-static-method-
name: field definitions after a static method in the same line
features: [class-fields]
---*/

class C {
  static m() { return 42; } /*{ fields }*/;
}

var c = new C();

assert.sameValue(C.m(), 42);
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,
});

/*{ assertions }*/