Debian Codegraph @

js/src/tests/test262/language/statements/async-generator/rest-params-trailing-comma-early-error.js

raw
1 // |reftest| error:SyntaxError
2 // This file was procedurally generated from the following sources:
3 // - src/function-forms/rest-params-trailing-comma-early-error.case
4 // - src/function-forms/syntax/async-gen-func-decl.template
5 /*---
6 description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (async generator function declaration)
7 esid: sec-asyncgenerator-definitions-instantiatefunctionobject
8 features: [async-iteration]
9 flags: [generated]
10 negative:
11 phase: parse
12 type: SyntaxError
13 info: |
14 AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier
15 ( FormalParameters ) { AsyncGeneratorBody }
16
17 [...]
18 3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody,
19 scope, strict).
20 [...]
21
22
23 Trailing comma in the parameters list
24
25 14.1 Function Definitions
26
27 FormalParameters[Yield, Await] :
28 [empty]
29 FunctionRestParameter[?Yield, ?Await]
30 FormalParameterList[?Yield, ?Await]
31 FormalParameterList[?Yield, ?Await] ,
32 FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
33 ---*/
34 $DONOTEVALUATE();
35
36
37 async function* f(...a,) {
38
39 }