Debian Codegraph @

js/src/tests/test262/language/expressions/async-generator/dflt-params-trailing-comma.js

raw
1 // |reftest| async
2 // This file was procedurally generated from the following sources:
3 // - src/function-forms/dflt-params-trailing-comma.case
4 // - src/function-forms/default/async-gen-func-expr.template
5 /*---
6 description: A trailing comma should not increase the respective length, using default parameters (async generator function expression)
7 esid: sec-asyncgenerator-definitions-evaluation
8 features: [async-iteration]
9 flags: [generated, async]
10 info: |
11 AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
12 AsyncGeneratorBody }
13
14 [...]
15 3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
16 AsyncGeneratorBody, scope, strict).
17 [...]
18
19
20 Trailing comma in the parameters list
21
22 14.1 Function Definitions
23
24 FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
25 ---*/
26
27
28 var callCount = 0;
29 // Stores a reference `ref` for case evaluation
30 var ref;
31 ref = async function*(a, b = 39,) {
32 assert.sameValue(a, 42);
33 assert.sameValue(b, 39);
34 callCount = callCount + 1;
35 };
36
37 ref(42, undefined, 1).next().then(() => {
38 assert.sameValue(callCount, 1, 'generator function invoked exactly once');
39 }).then($DONE, $DONE);
40
41 assert.sameValue(ref.length, 1, 'length is properly set');