Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/async-generator/dstr-dflt-obj-ptrn-rest-getter.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/dstr-binding/obj-ptrn-rest-getter.case
3 // - src/dstr-binding/default/async-gen-func-expr-dflt.template
4 /*---
5 description: Getter is called when obj is being deconstructed to a rest Object (async generator function expression (default parameter))
6 esid: sec-asyncgenerator-definitions-evaluation
7 features: [object-rest, async-iteration]
8 flags: [generated, async]
9 includes: [propertyHelper.js]
10 info: |
11 AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
12 AsyncGeneratorBody }
13
14 [...]
15 3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
16 AsyncGeneratorBody, scope, strict).
17 [...]
18
19 ---*/
20 var count = 0;
21
22
23 var callCount = 0;
24 var f;
25 f = async function*({...x} = { get v() { count++; return 2; } }) {
26 assert.sameValue(count, 1);
27
28 verifyProperty(x, "v", {
29 enumerable: true,
30 writable: true,
31 configurable: true,
32 value: 2
33 });
34 callCount = callCount + 1;
35 };
36
37 f().next().then(() => {
38 assert.sameValue(callCount, 1, 'invoked exactly once');
39 }).then($DONE, $DONE);