Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/async-generator/named-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-gen-named-func-expr.template
4 /*---
5 description: A trailing comma should not increase the respective length, using a single parameter (async generator named function expression)
6 esid: sec-asyncgenerator-definitions-evaluation
7 features: [async-iteration]
8 flags: [generated, async]
9 info: |
10 AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
11 ( FormalParameters ) { AsyncGeneratorBody }
12
13 [...]
14 7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
15 AsyncGeneratorBody, funcEnv, strict).
16 [...]
17
18
19 Trailing comma in the parameters list
20
21 14.1 Function Definitions
22
23 FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
24 ---*/
25
26
27 var callCount = 0;
28 // Stores a reference `ref` for case evaluation
29 var ref;
30 ref = async function* g(a,) {
31 assert.sameValue(a, 42);
32 callCount = callCount + 1;
33 };
34
35 ref(42, 39).next().then(() => {
36 assert.sameValue(callCount, 1, 'generator function invoked exactly once');
37 }).then($DONE, $DONE);
38
39 assert.sameValue(ref.length, 1, 'length is properly set');