Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/async-arrow-function/dflt-params-trailing-comma.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/function-forms/dflt-params-trailing-comma.case
3 // - src/function-forms/default/async-arrow-function.template
4 /*---
5 description: A trailing comma should not increase the respective length, using default parameters (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, b = 39,) => {
42 assert.sameValue(a, 42);
43 assert.sameValue(b, 39);
44 callCount = callCount + 1;
45 };
46
47 ref(42, undefined, 1).then(() => {
48 assert.sameValue(callCount, 1, 'async arrow function invoked exactly once')
49 }).then($DONE, $DONE);
50
51 assert.sameValue(ref.length, 1, 'length is properly set');