Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/object/method-definition/async-meth-params-trailing-comma-single.js

raw
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-meth.template
4 /*---
5 description: A trailing comma should not increase the respective length, using a single parameter (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,) {
26 assert.sameValue(a, 42);
27 callCount = callCount + 1;
28 }
29 };
30
31 // Stores a reference `ref` for case evaluation
32 var ref = __obj.method;
33
34 ref(42, 39).then(() => {
35 assert.sameValue(callCount, 1, 'async method invoked exactly once');
36 }).then($DONE, $DONE);
37
38 assert.sameValue(ref.length, 1, 'length is properly set');