Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/async-generator/named-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-gen-named-func-expr.template
4 /*---
5 description: A trailing comma should not increase the respective length, using default parameters (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, b = 39,) {
31 assert.sameValue(a, 42);
32 assert.sameValue(b, 39);
33 callCount = callCount + 1;
34 };
35
36 ref(42, undefined, 1).next().then(() => {
37 assert.sameValue(callCount, 1, 'generator function invoked exactly once');
38 }).then($DONE, $DONE);
39
40 assert.sameValue(ref.length, 1, 'length is properly set');