Merge pull request #1399 from Microsoft/checkSymbolExists

Check if the symbol exists before checking its visibility in isEntityNameVisible.
This commit is contained in:
Daniel Rosenwasser
2014-12-08 11:22:34 -08:00
+1 -1
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