Skip to content
Merged
Next Next commit
don't track computed name if symbol has no declaration
  • Loading branch information
gabritto committed Jul 21, 2021
commit 0a4e18e61c8745c0a059d805413552ff4bdfce88
20 changes: 11 additions & 9 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5243,16 +5243,18 @@ namespace ts {
const saveEnclosingDeclaration = context.enclosingDeclaration;
context.enclosingDeclaration = undefined;
if (context.tracker.trackSymbol && getCheckFlags(propertySymbol) & CheckFlags.Late && isLateBoundName(propertySymbol.escapedName)) {
const decl = first(propertySymbol.declarations!);
if (propertySymbol.declarations && hasLateBindableName(decl)) {
if (isBinaryExpression(decl)) {
const name = getNameOfDeclaration(decl);
if (name && isElementAccessExpression(name) && isPropertyAccessEntityNameExpression(name.argumentExpression)) {
trackComputedName(name.argumentExpression, saveEnclosingDeclaration, context);
if (propertySymbol.declarations) {
const decl = first(propertySymbol.declarations);
if (hasLateBindableName(decl)) {
if (isBinaryExpression(decl)) {
const name = getNameOfDeclaration(decl);
if (name && isElementAccessExpression(name) && isPropertyAccessEntityNameExpression(name.argumentExpression)) {
trackComputedName(name.argumentExpression, saveEnclosingDeclaration, context);
}
}
else {
trackComputedName(decl.name.expression, saveEnclosingDeclaration, context);
}
}
else {
trackComputedName(decl.name.expression, saveEnclosingDeclaration, context);
}
}
}
Expand Down