Skip to content

Commit 6338e2b

Browse files
committed
Fix 'resolveName' to correctly obtain local name of export default
1 parent 3c9a3c5 commit 6338e2b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,9 @@ module ts {
350350
}
351351
else if (location.kind === SyntaxKind.SourceFile ||
352352
(location.kind === SyntaxKind.ModuleDeclaration && (<ModuleDeclaration>location).name.kind === SyntaxKind.StringLiteral)) {
353-
result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & SymbolFlags.ModuleMember);
353+
result = getSymbolOfNode(location).exports["default"];
354354
let localSymbol = getLocalSymbolForExportDefault(result);
355-
if (result && (result.flags & meaning) && localSymbol && localSymbol.name === name) {
355+
if (result && localSymbol && (result.flags & meaning) && localSymbol.name === name) {
356356
break loop;
357357
}
358358
result = undefined;

src/compiler/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1695,7 +1695,7 @@ module ts {
16951695
}
16961696

16971697
export function getLocalSymbolForExportDefault(symbol: Symbol) {
1698-
return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & NodeFlags.Default) ? symbol.valueDeclaration.localSymbol : undefined;
1698+
return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & NodeFlags.Default) ? symbol.valueDeclaration.localSymbol : undefined;
16991699
}
17001700

17011701
/**

0 commit comments

Comments
 (0)