Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/object/method-definition/gen-meth-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-meth.template
4 /*---
5 description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (generator method)
6 esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
7 features: [generators]
8 flags: [generated]
9 negative:
10 phase: parse
11 type: SyntaxError
12 info: |
13 GeneratorMethod :
14 * PropertyName ( StrictFormalParameters ) { GeneratorBody }
15
16 1. Let propKey be the result of evaluating PropertyName.
17 2. ReturnIfAbrupt(propKey).
18 3. If the function code for this GeneratorMethod is strict mode code,
19 let strict be true. Otherwise let strict be false.
20 4. Let scope be the running execution context's LexicalEnvironment.
21 5. Let closure be GeneratorFunctionCreate(Method,
22 StrictFormalParameters, GeneratorBody, scope, strict).
23 [...]
24
25 9.2.1 [[Call]] ( thisArgument, argumentsList)
26
27 [...]
28 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
29 [...]
30
31 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
32
33 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
34 [...]
35
36 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
37
38 [...]
39 23. Let iteratorRecord be Record {[[iterator]]:
40 CreateListIterator(argumentsList), [[done]]: false}.
41 24. If hasDuplicates is true, then
42 [...]
43 25. Else,
44 b. Let formalStatus be IteratorBindingInitialization for formals with
45 iteratorRecord and env as arguments.
46 [...]
47
48
49 Trailing comma in the parameters list
50
51 14.1 Function Definitions
52
53 FormalParameters[Yield, Await] :
54 [empty]
55 FunctionRestParameter[?Yield, ?Await]
56 FormalParameterList[?Yield, ?Await]
57 FormalParameterList[?Yield, ?Await] ,
58 FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
59 ---*/
60 throw "Test262: This statement should not be evaluated.";
61
62 0, {
63 *method(...a,) {
64
65 }
66 };