mirror of
https://github.com/tc39/test262.git
synced 2025-05-03 14:30:27 +02:00
Early errors may result from parsing the source text of a test file, but they may also result from parsing some other source text as referenced through the ES2015 module syntax. The latter form of early error is not necessarily detectable by ECMAScript parsers, however. Because of this, the label "early" is not sufficiently precise for all Test262 consumers to correctly interpret all tests. Update the "phase" name of "early" to "parse" for all those negative tests that describe errors resulting from parsing of the file's source text directly. A forthcoming commit will update the remaining tests to use a "phase" name that is more specific to module resolution.
39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
// This file was procedurally generated from the following sources:
|
|
// - src/function-forms/rest-params-trailing-comma-early-error.case
|
|
// - src/function-forms/syntax/async-gen-named-func-expr.template
|
|
/*---
|
|
description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (async generator named function expression)
|
|
esid: sec-asyncgenerator-definitions-evaluation
|
|
features: [async-iteration]
|
|
flags: [generated]
|
|
negative:
|
|
phase: parse
|
|
type: SyntaxError
|
|
info: |
|
|
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
|
( FormalParameters ) { AsyncGeneratorBody }
|
|
|
|
[...]
|
|
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
|
AsyncGeneratorBody, funcEnv, strict).
|
|
[...]
|
|
|
|
|
|
Trailing comma in the parameters list
|
|
|
|
14.1 Function Definitions
|
|
|
|
FormalParameters[Yield, Await] :
|
|
[empty]
|
|
FunctionRestParameter[?Yield, ?Await]
|
|
FormalParameterList[?Yield, ?Await]
|
|
FormalParameterList[?Yield, ?Await] ,
|
|
FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
|
|
---*/
|
|
throw "Test262: This statement should not be evaluated.";
|
|
|
|
|
|
0, async function* g(...a,) {
|
|
|
|
};
|