| 1 |
// This file was procedurally generated from the following sources: |
| 2 |
// - src/arguments/args-trailing-comma-single-args.case |
| 3 |
// - src/arguments/default/async-gen-func-expr.template |
| 4 |
/*--- |
| 5 |
description: A trailing comma should not increase the arguments.length, using a single arg (async generator function expression) |
| 6 |
esid: sec-asyncgenerator-definitions-evaluation |
| 7 |
features: [async-iteration] |
| 8 |
flags: [generated, async] |
| 9 |
info: | |
| 10 |
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) { |
| 11 |
AsyncGeneratorBody } |
| 12 |
|
| 13 |
[...] |
| 14 |
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, |
| 15 |
AsyncGeneratorBody, scope, strict). |
| 16 |
[...] |
| 17 |
|
| 18 |
|
| 19 |
Trailing comma in the arguments list |
| 20 |
|
| 21 |
12.3 Left-Hand-Side Expressions |
| 22 |
|
| 23 |
Arguments[Yield, Await] : ( ArgumentList[?Yield, ?Await] , ) |
| 24 |
---*/ |
| 25 |
|
| 26 |
|
| 27 |
var callCount = 0; |
| 28 |
// Stores a reference `ref` for case evaluation |
| 29 |
var ref; |
| 30 |
ref = async function*() { |
| 31 |
assert.sameValue(arguments.length, 1); |
| 32 |
assert.sameValue(arguments[0], 42); |
| 33 |
callCount = callCount + 1; |
| 34 |
}; |
| 35 |
|
| 36 |
ref(42,).next().then(() => { |
| 37 |
assert.sameValue(callCount, 1, 'generator function invoked exactly once'); |
| 38 |
}).then($DONE, $DONE); |