Debian Codegraph @

js/src/tests/test262/language/expressions/class/async-gen-method-static/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/cls-expr-async-gen-meth-static.template
5 /*---
6 description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (static class expression async generator method)
7 esid: sec-class-definitions-runtime-semantics-evaluation
8 features: [async-iteration]
9 flags: [generated]
10 negative:
11 phase: parse
12 type: SyntaxError
13 info: |
14 ClassExpression : class BindingIdentifieropt ClassTail
15
16 1. If BindingIdentifieropt is not present, let className be undefined.
17 2. Else, let className be StringValue of BindingIdentifier.
18 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
19 with argument className.
20 [...]
21
22 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
23
24 21. For each ClassElement m in order from methods
25 a. If IsStatic of m is false, then
26 b. Else,
27 Let status be the result of performing PropertyDefinitionEvaluation
28 for m with arguments F and false.
29 [...]
30
31 Runtime Semantics: PropertyDefinitionEvaluation
32
33 AsyncGeneratorMethod :
34 async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
35 { AsyncGeneratorBody }
36
37 1. Let propKey be the result of evaluating PropertyName.
38 2. ReturnIfAbrupt(propKey).
39 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
40 Otherwise let strict be false.
41 4. Let scope be the running execution context's LexicalEnvironment.
42 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
43 AsyncGeneratorBody, scope, strict).
44 [...]
45
46
47 Trailing comma in the parameters list
48
49 14.1 Function Definitions
50
51 FormalParameters[Yield, Await] :
52 [empty]
53 FunctionRestParameter[?Yield, ?Await]
54 FormalParameterList[?Yield, ?Await]
55 FormalParameterList[?Yield, ?Await] ,
56 FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
57 ---*/
58 $DONOTEVALUATE();
59
60 0, class {
61 static async *method(...a,) {
62
63 }
64 };