Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/src/class-fields/productions/cls-expr-after-same-line-method.template

raw
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-method-
6 name: field definitions after a 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 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(c.m, C.prototype.m);
22
23 verifyProperty(C.prototype, "m", {
24 enumerable: false,
25 configurable: true,
26 writable: true,
27 });
28
29 /*{ assertions }*/