Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/generators/rest-params-trailing-comma-early-error.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/function-forms/rest-params-trailing-comma-early-error.case
3 // - src/function-forms/syntax/gen-func-expr.template
4 /*---
5 description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (generator function expression)
6 esid: sec-generator-function-definitions-runtime-semantics-evaluation
7 features: [generators]
8 flags: [generated]
9 negative:
10 phase: parse
11 type: SyntaxError
12 info: |
13 GeneratorExpression : function * ( FormalParameters ) { GeneratorBody }
14
15 [...]
16 3. Let closure be GeneratorFunctionCreate(Normal, FormalParameters,
17 GeneratorBody, scope, strict).
18 [...]
19
20 9.2.1 [[Call]] ( thisArgument, argumentsList)
21
22 [...]
23 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
24 [...]
25
26 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
27
28 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
29 [...]
30
31 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
32
33 [...]
34 23. Let iteratorRecord be Record {[[iterator]]:
35 CreateListIterator(argumentsList), [[done]]: false}.
36 24. If hasDuplicates is true, then
37 [...]
38 25. Else,
39 b. Let formalStatus be IteratorBindingInitialization for formals with
40 iteratorRecord and env as arguments.
41 [...]
42
43
44 Trailing comma in the parameters list
45
46 14.1 Function Definitions
47
48 FormalParameters[Yield, Await] :
49 [empty]
50 FunctionRestParameter[?Yield, ?Await]
51 FormalParameterList[?Yield, ?Await]
52 FormalParameterList[?Yield, ?Await] ,
53 FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
54 ---*/
55 throw "Test262: This statement should not be evaluated.";
56
57 0, function*(...a,) {
58
59 };