| 1 |
// This file was procedurally generated from the following sources: |
| 2 |
// - src/function-forms/params-trailing-comma-single.case |
| 3 |
// - src/function-forms/default/async-gen-func-expr.template |
| 4 |
/*--- |
| 5 |
description: A trailing comma should not increase the respective length, using a single parameter (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 parameters list |
| 20 |
|
| 21 |
14.1 Function Definitions |
| 22 |
|
| 23 |
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] , |
| 24 |
---*/ |
| 25 |
|
| 26 |
|
| 27 |
var callCount = 0; |
| 28 |
// Stores a reference `ref` for case evaluation |
| 29 |
var ref; |
| 30 |
ref = async function*(a,) { |
| 31 |
assert.sameValue(a, 42); |
| 32 |
callCount = callCount + 1; |
| 33 |
}; |
| 34 |
|
| 35 |
ref(42, 39).next().then(() => { |
| 36 |
assert.sameValue(callCount, 1, 'generator function invoked exactly once'); |
| 37 |
}).then($DONE, $DONE); |
| 38 |
|
| 39 |
assert.sameValue(ref.length, 1, 'length is properly set'); |