update getSymbolInfo

This commit is contained in:
Mohamed Hegazy
2014-08-21 00:13:29 -07:00
parent e0ffc47acc
commit bbeeb8df7f
4 changed files with 53 additions and 14 deletions

View File

@@ -6849,6 +6849,11 @@ module ts {
}
function getSymbolInfo(node: Node) {
if (isDeclarationOrFunctionExpressionOrCatchVariableName(node)) {
// In this case, we call getSymbolOfNode instead of getSymbolInfo because it is a declaration
return getSymbolOfNode(node.parent);
}
switch (node.kind) {
case SyntaxKind.Identifier:
case SyntaxKind.PropertyAccess:
@@ -6890,18 +6895,6 @@ module ts {
return moduleType ? moduleType.symbol : undefined;
}
break;
// External module name in an ambient declaration
case SyntaxKind.ModuleDeclaration:
// Property with name as string or numeric literal
case SyntaxKind.Property:
case SyntaxKind.PropertyAssignment:
// Enum member with string or numeric literal name
case SyntaxKind.EnumMember:
if ((<Declaration>node.parent).name === node) {
return getSymbolOfNode(node.parent);
}
break;
}
break;
}