Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/object/method-definition/async-meth-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-meth.template
4 /*---
5 description: A trailing comma should not increase the respective length, using default parameters (async method)
6 esid: sec-async-function-definitions
7 flags: [generated, async]
8 info: |
9 14.6 Async Function Definitions
10
11 AsyncMethod :
12 async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
13
14
15 Trailing comma in the parameters list
16
17 14.1 Function Definitions
18
19 FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
20 ---*/
21
22
23 var callCount = 0;
24 var __obj = {
25 async method(a, b = 39,) {
26 assert.sameValue(a, 42);
27 assert.sameValue(b, 39);
28 callCount = callCount + 1;
29 }
30 };
31
32 // Stores a reference `ref` for case evaluation
33 var ref = __obj.method;
34
35 ref(42, undefined, 1).then(() => {
36 assert.sameValue(callCount, 1, 'async method invoked exactly once');
37 }).then($DONE, $DONE);
38
39 assert.sameValue(ref.length, 1, 'length is properly set');