mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
support case when variable is re-assigned
This commit is contained in:
1 parent
1bcd8da415
commit
29fc8c30ba
3 files changed
+22
-1
No files matched your search
@@ -83,8 +83,12 @@ namespace ts.refactor.convertStringOrTemplateLiteral {
|
||||
return text.length === 0 ? [expression] : [expression, createStringLiteral(text)];
|
||||
}
|
||||
|
||||
function isNotEqualsOperator(node: BinaryExpression) {
|
||||
return node.operatorToken.kind !== SyntaxKind.EqualsToken;
|
||||
}
|
||||
|
||||
function getParentBinaryExpression(expr: Node) {
|
||||
while (isBinaryExpression(expr.parent)) {
|
||||
while (isBinaryExpression(expr.parent) && isNotEqualsOperator(expr.parent)) {
|
||||
expr = expr.parent;
|
||||
}
|
||||
return expr;
|
||||
|
||||
Reference in new issue
Block a user