Respond to code review remarks
This commit is contained in:
parent
383f01dbf6
commit
0c5d736251
3 changed files with 17 additions and 10 deletions
|
@ -351,7 +351,8 @@ module ts {
|
|||
}
|
||||
else if (location.kind === SyntaxKind.SourceFile) {
|
||||
result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & SymbolFlags.ModuleMember);
|
||||
if (result && (result.flags & meaning) && result.valueDeclaration && (result.valueDeclaration.flags & NodeFlags.Default) && result.valueDeclaration.localSymbol.name === name) {
|
||||
let localSymbol = getLocalSymbolForExportDefault(result);
|
||||
if (result && (result.flags & meaning) && localSymbol && localSymbol.name === name) {
|
||||
break loop;
|
||||
}
|
||||
result = undefined;
|
||||
|
|
|
@ -1768,4 +1768,7 @@ module ts {
|
|||
}
|
||||
}
|
||||
|
||||
export function getLocalSymbolForExportDefault(symbol: Symbol) {
|
||||
return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & NodeFlags.Default) ? symbol.valueDeclaration.localSymbol : undefined;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2405,9 +2405,12 @@ module ts {
|
|||
}
|
||||
|
||||
// If this is the default export, get the name of the declaration if it exists
|
||||
if (displayName === "default" && symbol.valueDeclaration && (symbol.valueDeclaration.flags & NodeFlags.Default) && symbol.valueDeclaration.localSymbol && symbol.valueDeclaration.localSymbol.name) {
|
||||
if (displayName === "default") {
|
||||
let localSymbol = getLocalSymbolForExportDefault(symbol);
|
||||
if (localSymbol && localSymbol.name) {
|
||||
displayName = symbol.valueDeclaration.localSymbol.name;
|
||||
}
|
||||
}
|
||||
|
||||
let firstCharCode = displayName.charCodeAt(0);
|
||||
// First check of the displayName is not external module; if it is an external module, it is not valid entry
|
||||
|
|
Loading…
Reference in a new issue