| 1 |
// This file was procedurally generated from the following sources: |
| 2 |
// - src/dstr-binding/ary-ptrn-rest-init-ary.case |
| 3 |
// - src/dstr-binding/default/async-gen-func-expr.template |
| 4 |
/*--- |
| 5 |
description: Reset element (nested array pattern) does not support initializer (async generator function expression) |
| 6 |
esid: sec-asyncgenerator-definitions-evaluation |
| 7 |
features: [async-iteration] |
| 8 |
flags: [generated, async] |
| 9 |
negative: |
| 10 |
phase: parse |
| 11 |
type: SyntaxError |
| 12 |
info: | |
| 13 |
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) { |
| 14 |
AsyncGeneratorBody } |
| 15 |
|
| 16 |
[...] |
| 17 |
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, |
| 18 |
AsyncGeneratorBody, scope, strict). |
| 19 |
[...] |
| 20 |
|
| 21 |
|
| 22 |
13.3.3 Destructuring Binding Patterns |
| 23 |
ArrayBindingPattern[Yield] : |
| 24 |
[ Elisionopt BindingRestElement[?Yield]opt ] |
| 25 |
[ BindingElementList[?Yield] ] |
| 26 |
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ] |
| 27 |
---*/ |
| 28 |
throw "Test262: This statement should not be evaluated."; |
| 29 |
|
| 30 |
|
| 31 |
var callCount = 0; |
| 32 |
var f; |
| 33 |
f = async function*([...[ x ] = []]) { |
| 34 |
|
| 35 |
callCount = callCount + 1; |
| 36 |
}; |
| 37 |
|
| 38 |
f([]).next().then(() => { |
| 39 |
assert.sameValue(callCount, 1, 'invoked exactly once'); |
| 40 |
}).then($DONE, $DONE); |