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