Check if the symbol exists before checking its visibility.

Should fix #1348.
This commit is contained in:
Daniel Rosenwasser 2014-12-05 18:13:58 -08:00
parent a4ab192b6f
commit cd8cd0ce3a

View File

@ -1012,7 +1012,7 @@ module ts {
var symbol = resolveName(enclosingDeclaration, (<Identifier>firstIdentifier).text, meaning, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined);
// Verify if the symbol is accessible
return hasVisibleDeclarations(symbol) || <SymbolVisibilityResult>{
return (symbol && hasVisibleDeclarations(symbol)) || <SymbolVisibilityResult>{
accessibility: SymbolAccessibility.NotAccessible,
errorSymbolName: getTextOfNode(firstIdentifier),
errorNode: firstIdentifier