Debian Codegraph @

js/src/tests/test262/language/statements/async-generator/params-trailing-comma-multiple.js

raw
1 // |reftest| async
2 // This file was procedurally generated from the following sources:
3 // - src/function-forms/params-trailing-comma-multiple.case
4 // - src/function-forms/default/async-gen-func-decl.template
5 /*---
6 description: A trailing comma should not increase the respective length, using multiple parameters (async generator function declaration)
7 esid: sec-asyncgenerator-definitions-instantiatefunctionobject
8 features: [async-iteration]
9 flags: [generated, async]
10 info: |
11 AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier
12 ( FormalParameters ) { AsyncGeneratorBody }
13
14 [...]
15 3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody,
16 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 async function* ref(a, b,) {
31 assert.sameValue(a, 42);
32 assert.sameValue(b, 39);
33 callCount = callCount + 1;
34 }
35
36 ref(42, 39, 1).next().then(() => {
37 assert.sameValue(callCount, 1, 'generator function invoked exactly once');
38 }).then($DONE, $DONE);
39
40 assert.sameValue(ref.length, 2, 'length is properly set');