mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 11:24:29 -05:00
Improve parse error for double comma somewhere inside a call expression (#20399)
This commit is contained in:
@@ -1429,9 +1429,13 @@ namespace ts {
|
||||
return token() === SyntaxKind.CommaToken || token() === SyntaxKind.DotDotDotToken || isIdentifierOrPattern();
|
||||
case ParsingContext.TypeParameters:
|
||||
return isIdentifier();
|
||||
case ParsingContext.ArgumentExpressions:
|
||||
case ParsingContext.ArrayLiteralMembers:
|
||||
return token() === SyntaxKind.CommaToken || token() === SyntaxKind.DotDotDotToken || isStartOfExpression();
|
||||
if (token() === SyntaxKind.CommaToken) {
|
||||
return true;
|
||||
}
|
||||
// falls through
|
||||
case ParsingContext.ArgumentExpressions:
|
||||
return token() === SyntaxKind.DotDotDotToken || isStartOfExpression();
|
||||
case ParsingContext.Parameters:
|
||||
return isStartOfParameter();
|
||||
case ParsingContext.TypeArguments:
|
||||
|
||||
Reference in New Issue
Block a user