Check for undefined symbols

This commit is contained in:
Mohamed Hegazy
2017-01-30 16:42:12 -08:00
parent e8a2173fee
commit 793d8be6e0

View File

@@ -2216,7 +2216,7 @@ namespace ts {
classPrototype.parent = leftSideOfAssignment;
let funcSymbol = container.locals.get(constructorFunction.text);
if (isDeclarationOfFunctionOrClassExpression(funcSymbol)) {
if (funcSymbol && isDeclarationOfFunctionOrClassExpression(funcSymbol)) {
funcSymbol = (funcSymbol.valueDeclaration as VariableDeclaration).initializer.symbol;
}
@@ -2246,7 +2246,7 @@ namespace ts {
target.parent = leftSideOfAssignment;
let funcSymbol = container.locals.get(target.text);
if (isDeclarationOfFunctionOrClassExpression(funcSymbol)) {
if (funcSymbol && isDeclarationOfFunctionOrClassExpression(funcSymbol)) {
funcSymbol = (funcSymbol.valueDeclaration as VariableDeclaration).initializer.symbol;
}