Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/object/method-definition/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/meth.template
4 /*---
5 description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (method)
6 esid: sec-runtime-semantics-definemethod
7 flags: [generated]
8 negative:
9 phase: parse
10 type: SyntaxError
11 info: |
12 MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
13
14 [...]
15 6. Let closure be FunctionCreate(kind, StrictFormalParameters,
16 FunctionBody, scope, strict). If functionPrototype was passed as a
17 parameter then pass its value as the functionPrototype optional argument
18 of FunctionCreate.
19 [...]
20
21 9.2.1 [[Call]] ( thisArgument, argumentsList)
22
23 [...]
24 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
25 [...]
26
27 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
28
29 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
30 [...]
31
32 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
33
34 [...]
35 23. Let iteratorRecord be Record {[[iterator]]:
36 CreateListIterator(argumentsList), [[done]]: false}.
37 24. If hasDuplicates is true, then
38 [...]
39 25. Else,
40 b. Let formalStatus be IteratorBindingInitialization for formals with
41 iteratorRecord and env as arguments.
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, {
58 method(...a,) {
59
60 }
61 };