Check for initializer before using it (#18708)

This commit is contained in:
Mohamed Hegazy
2017-09-22 17:14:22 -07:00
committed by GitHub
parent b2ec33389c
commit 4221fb6a39
4 changed files with 57 additions and 2 deletions

View File

@@ -16491,7 +16491,7 @@ namespace ts {
// If the symbol of the node has members, treat it like a constructor.
const symbol = isFunctionDeclaration(node) || isFunctionExpression(node) ? getSymbolOfNode(node) :
isVariableDeclaration(node) && isFunctionExpression(node.initializer) ? getSymbolOfNode(node.initializer) :
isVariableDeclaration(node) && node.initializer && isFunctionExpression(node.initializer) ? getSymbolOfNode(node.initializer) :
undefined;
return symbol && symbol.members !== undefined;