Debian Codegraph @

js/src/tests/test262/language/expressions/async-arrow-function/params-trailing-comma-multiple.js

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