| 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-arrow-function.template |
| 4 |
/*--- |
| 5 |
description: A trailing comma should not increase the respective length, using a single parameter (async arrow function expression) |
| 6 |
esid: sec-async-arrow-function-definitions |
| 7 |
flags: [generated, async] |
| 8 |
info: | |
| 9 |
14.7 Async Arrow Function Definitions |
| 10 |
|
| 11 |
AsyncArrowFunction : |
| 12 |
... |
| 13 |
CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody |
| 14 |
|
| 15 |
AsyncConciseBody : |
| 16 |
{ AsyncFunctionBody } |
| 17 |
|
| 18 |
... |
| 19 |
|
| 20 |
Supplemental Syntax |
| 21 |
|
| 22 |
When processing an instance of the production AsyncArrowFunction : |
| 23 |
CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody the interpretation of |
| 24 |
CoverCallExpressionAndAsyncArrowHead is refined using the following grammar: |
| 25 |
|
| 26 |
AsyncArrowHead : |
| 27 |
async ArrowFormalParameters |
| 28 |
|
| 29 |
|
| 30 |
Trailing comma in the parameters list |
| 31 |
|
| 32 |
14.1 Function Definitions |
| 33 |
|
| 34 |
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] , |
| 35 |
---*/ |
| 36 |
|
| 37 |
|
| 38 |
var callCount = 0; |
| 39 |
|
| 40 |
// Stores a reference `ref` for case evaluation |
| 41 |
var ref = async (a,) => { |
| 42 |
assert.sameValue(a, 42); |
| 43 |
callCount = callCount + 1; |
| 44 |
}; |
| 45 |
|
| 46 |
ref(42, 39).then(() => { |
| 47 |
assert.sameValue(callCount, 1, 'async arrow function invoked exactly once') |
| 48 |
}).then($DONE, $DONE); |
| 49 |
|
| 50 |
assert.sameValue(ref.length, 1, 'length is properly set'); |