Skip to content

Commit 793d8be

Browse files
committed
Check for undefined symbols
1 parent e8a2173 commit 793d8be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/binder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,7 +2216,7 @@ namespace ts {
22162216
classPrototype.parent = leftSideOfAssignment;
22172217

22182218
let funcSymbol = container.locals.get(constructorFunction.text);
2219-
if (isDeclarationOfFunctionOrClassExpression(funcSymbol)) {
2219+
if (funcSymbol && isDeclarationOfFunctionOrClassExpression(funcSymbol)) {
22202220
funcSymbol = (funcSymbol.valueDeclaration as VariableDeclaration).initializer.symbol;
22212221
}
22222222

@@ -2246,7 +2246,7 @@ namespace ts {
22462246
target.parent = leftSideOfAssignment;
22472247

22482248
let funcSymbol = container.locals.get(target.text);
2249-
if (isDeclarationOfFunctionOrClassExpression(funcSymbol)) {
2249+
if (funcSymbol && isDeclarationOfFunctionOrClassExpression(funcSymbol)) {
22502250
funcSymbol = (funcSymbol.valueDeclaration as VariableDeclaration).initializer.symbol;
22512251
}
22522252

0 commit comments

Comments
 (0)