| 1 |
// This file was procedurally generated from the following sources: |
| 2 |
// - src/dstr-binding/obj-ptrn-rest-val-obj.case |
| 3 |
// - src/dstr-binding/default/async-gen-func-named-expr.template |
| 4 |
/*--- |
| 5 |
description: Rest object contains just unextracted data (async generator named function expression) |
| 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 * BindingIdentifier |
| 12 |
( FormalParameters ) { AsyncGeneratorBody } |
| 13 |
|
| 14 |
[...] |
| 15 |
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, |
| 16 |
AsyncGeneratorBody, funcEnv, strict). |
| 17 |
[...] |
| 18 |
|
| 19 |
---*/ |
| 20 |
|
| 21 |
|
| 22 |
var callCount = 0; |
| 23 |
var f; |
| 24 |
f = async function* h({a, b, ...rest}) { |
| 25 |
assert.sameValue(rest.a, undefined); |
| 26 |
assert.sameValue(rest.b, undefined); |
| 27 |
|
| 28 |
verifyProperty(rest, "x", { |
| 29 |
enumerable: true, |
| 30 |
writable: true, |
| 31 |
configurable: true, |
| 32 |
value: 1 |
| 33 |
}); |
| 34 |
|
| 35 |
verifyProperty(rest, "y", { |
| 36 |
enumerable: true, |
| 37 |
writable: true, |
| 38 |
configurable: true, |
| 39 |
value: 2 |
| 40 |
}); |
| 41 |
callCount = callCount + 1; |
| 42 |
}; |
| 43 |
|
| 44 |
f({x: 1, y: 2, a: 5, b: 3}).next().then(() => { |
| 45 |
assert.sameValue(callCount, 1, 'invoked exactly once'); |
| 46 |
}).then($DONE, $DONE); |