mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Classify the '=' sign in variable/parameter/property as if it was an operator.
This commit is contained in:
1 parent
48bef4698b
commit
a6ea497ff1
2 files changed
+10
-3
No files matched your search
@@ -4985,10 +4985,17 @@ module ts {
|
||||
}
|
||||
|
||||
if (isPunctuation(tokenKind)) {
|
||||
// the '=' in a variable declaration is special cased here.
|
||||
if (token) {
|
||||
if (tokenKind === SyntaxKind.EqualsToken) {
|
||||
// the '=' in a variable declaration is special cased here.
|
||||
if (token.parent.kind === SyntaxKind.VariableDeclaration ||
|
||||
token.parent.kind === SyntaxKind.PropertyDeclaration ||
|
||||
token.parent.kind === SyntaxKind.Parameter) {
|
||||
return ClassificationTypeNames.operator;
|
||||
}
|
||||
}
|
||||
|
||||
if (token.parent.kind === SyntaxKind.BinaryExpression ||
|
||||
token.parent.kind === SyntaxKind.VariableDeclaration ||
|
||||
token.parent.kind === SyntaxKind.PrefixUnaryExpression ||
|
||||
token.parent.kind === SyntaxKind.PostfixUnaryExpression ||
|
||||
token.parent.kind === SyntaxKind.ConditionalExpression) {
|
||||
|
||||
Reference in new issue
Block a user