mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Restore reference change
This commit is contained in:
parent
4c90ba9456
commit
21963ce337
@ -837,9 +837,8 @@ namespace ts {
|
||||
function isNarrowableReference(expr: Expression): boolean {
|
||||
return expr.kind === SyntaxKind.Identifier || expr.kind === SyntaxKind.ThisKeyword || expr.kind === SyntaxKind.SuperKeyword ||
|
||||
(isPropertyAccessExpression(expr) || isNonNullExpression(expr) || isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression) ||
|
||||
isElementAccessExpression(expr) && isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression);
|
||||
// ||
|
||||
// isAssignmentExpression(expr) && isNarrowableReference(expr.left);
|
||||
isElementAccessExpression(expr) && isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression) ||
|
||||
isAssignmentExpression(expr) && isNarrowableReference(expr.left);
|
||||
}
|
||||
|
||||
function containsNarrowableReference(expr: Expression): boolean {
|
||||
|
||||
@ -20131,11 +20131,11 @@ namespace ts {
|
||||
case SyntaxKind.ParenthesizedExpression:
|
||||
case SyntaxKind.NonNullExpression:
|
||||
return isMatchingReference(source, (target as NonNullExpression | ParenthesizedExpression).expression);
|
||||
// case SyntaxKind.BinaryExpression:
|
||||
// if (isAssignmentExpression(target)) {
|
||||
// return isMatchingReference(source, target.left);
|
||||
// }
|
||||
// break;
|
||||
case SyntaxKind.BinaryExpression:
|
||||
if (isAssignmentExpression(target)) {
|
||||
return isMatchingReference(source, target.left);
|
||||
}
|
||||
break;
|
||||
}
|
||||
switch (source.kind) {
|
||||
case SyntaxKind.Identifier:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user