Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/object/method-definition/async-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/async-gen-meth.template
4 /*---
5 description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (async generator method)
6 esid: sec-asyncgenerator-definitions-propertydefinitionevaluation
7 features: [async-iteration]
8 flags: [generated]
9 negative:
10 phase: parse
11 type: SyntaxError
12 info: |
13 AsyncGeneratorMethod :
14 async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
15 { AsyncGeneratorBody }
16
17 1. Let propKey be the result of evaluating PropertyName.
18 2. ReturnIfAbrupt(propKey).
19 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
20 Otherwise let strict be false.
21 4. Let scope be the running execution context's LexicalEnvironment.
22 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
23 AsyncGeneratorBody, scope, strict).
24 [...]
25
26
27 Trailing comma in the parameters list
28
29 14.1 Function Definitions
30
31 FormalParameters[Yield, Await] :
32 [empty]
33 FunctionRestParameter[?Yield, ?Await]
34 FormalParameterList[?Yield, ?Await]
35 FormalParameterList[?Yield, ?Await] ,
36 FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
37 ---*/
38 throw "Test262: This statement should not be evaluated.";
39
40 0, {
41 async *method(...a,) {
42
43 }
44 };