summaryrefslogtreecommitdiff
path: root/src/class-fields/productions/cls-decl-new-sc-line-generator.template
blob: 3ae2f7ebaab1d7d76ccf39066d7d02775b26211a (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-new-sc-line-gen-
name: field definitions followed by a method in a new line with a semicolon
features: [class, class-fields-public, generators]
esid: prod-FieldDefinition
includes: [propertyHelper.js]
---*/

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

var c = new C();

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

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

/*{ assertions }*/