diff options
Diffstat (limited to 'src/class-fields/default/cls-decl-new-sc-line-generator.template')
-rw-r--r-- | src/class-fields/default/cls-decl-new-sc-line-generator.template | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/class-fields/default/cls-decl-new-sc-line-generator.template b/src/class-fields/default/cls-decl-new-sc-line-generator.template new file mode 100644 index 000000000..c124d126e --- /dev/null +++ b/src/class-fields/default/cls-decl-new-sc-line-generator.template @@ -0,0 +1,27 @@ +// 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-fields, generators] +---*/ + +class C { + /*{ fields }*/; + *m() { return 42; } +} + +var c = new C(); + +assert.sameValue(c.g().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 }*/ |