Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/src/class-fields/productions/cls-expr-after-same-line-async-gen.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-same-line-async-gen-
6 name: field definitions after an 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 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(c.m, C.prototype.m);
22
23 verifyProperty(C.prototype, "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);