mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #9298 from OrangeShark/new-rest-param-error
New rest parameter properties error message
This commit is contained in:
@@ -18204,7 +18204,10 @@ namespace ts {
|
||||
return grammarErrorOnNode(lastDeclare, Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare");
|
||||
}
|
||||
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);
|
||||
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_may_not_be_declared_using_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);
|
||||
|
||||
@@ -571,7 +571,7 @@
|
||||
"category": "Error",
|
||||
"code": 1186
|
||||
},
|
||||
"A parameter property may not be a binding pattern.": {
|
||||
"A parameter property may not be declared using a binding pattern.": {
|
||||
"category": "Error",
|
||||
"code": 1187
|
||||
},
|
||||
@@ -851,6 +851,10 @@
|
||||
"category": "Error",
|
||||
"code": 1316
|
||||
},
|
||||
"A parameter property cannot be declared using a rest parameter.": {
|
||||
"category": "Error",
|
||||
"code": 1317
|
||||
},
|
||||
"Duplicate identifier '{0}'.": {
|
||||
"category": "Error",
|
||||
"code": 2300
|
||||
|
||||
@@ -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