mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Add error message for rest parameter properties
This commit is contained in:
@@ -18206,6 +18206,9 @@ namespace ts {
|
||||
else if (node.kind === SyntaxKind.Parameter && (flags & NodeFlags.ParameterPropertyModifier) && isBindingPattern((<ParameterDeclaration>node).name)) {
|
||||
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_may_not_be_a_binding_pattern);
|
||||
}
|
||||
else if (node.kind === SyntaxKind.Parameter && (flags & NodeFlags.ParameterPropertyModifier) && (<ParameterDeclaration>node).dotDotDotToken) {
|
||||
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter);
|
||||
}
|
||||
if (flags & NodeFlags.Async) {
|
||||
return checkGrammarAsyncModifier(node, lastAsync);
|
||||
}
|
||||
|
||||
@@ -1178,6 +1178,7 @@ namespace ts {
|
||||
return token === SyntaxKind.OpenBracketToken
|
||||
|| token === SyntaxKind.OpenBraceToken
|
||||
|| token === SyntaxKind.AsteriskToken
|
||||
|| token === SyntaxKind.DotDotDotToken
|
||||
|| isLiteralPropertyName();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user