| 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-async-gen- |
| 6 |
name: field definitions after a static async generator in the same line |
| 7 |
features: [class, class-fields-public, async-iteration] |
| 8 |
flags: [async] |
| 9 |
esid: prod-FieldDefinition |
| 10 |
includes: [propertyHelper.js] |
| 11 |
---*/ |
| 12 |
|
| 13 |
var C = class { |
| 14 |
static async *m() { return 42; } /*{ fields }*/; |
| 15 |
/*{ privateinspectionfunctions }*/ |
| 16 |
} |
| 17 |
|
| 18 |
var c = new C(); |
| 19 |
|
| 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 |
}, {restore: true}); |
| 28 |
|
| 29 |
/*{ assertions }*/ |
| 30 |
|
| 31 |
C.m().next().then(function(v) { |
| 32 |
assert.sameValue(v.value, 42); |
| 33 |
assert.sameValue(v.done, true); |
| 34 |
}, $DONE).then($DONE, $DONE); |