Skip to content

Commit 5b510ce

Browse files
committed
Use existing function to resolve export= declarations
1 parent 56b3353 commit 5b510ce

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

src/compiler/checker.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -982,13 +982,7 @@ namespace ts {
982982
}
983983

984984
function getTargetOfGlobalModuleExportDeclaration(node: GlobalModuleExportDeclaration): Symbol {
985-
const moduleSymbol = node.parent.symbol;
986-
if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports["export="]) {
987-
return getMergedSymbol(moduleSymbol.exports["export="].exportSymbol);
988-
}
989-
else {
990-
return getMergedSymbol(moduleSymbol);
991-
}
985+
return resolveExternalModuleSymbol(node.parent.symbol);
992986
}
993987

994988
function getTargetOfExportSpecifier(node: ExportSpecifier): Symbol {

tests/baselines/reference/umd6.symbols

+2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
/// <reference path="foo.d.ts" />
33
let y: number = Foo.fn();
44
>y : Symbol(y, Decl(a.ts, 1, 3))
5+
>Foo.fn : Symbol(Foo.fn, Decl(foo.d.ts, 1, 25))
56
>Foo : Symbol(Foo, Decl(foo.d.ts, 4, 15))
7+
>fn : Symbol(Foo.fn, Decl(foo.d.ts, 1, 25))
68

79
=== tests/cases/conformance/externalModules/foo.d.ts ===
810

tests/baselines/reference/umd6.types

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
/// <reference path="foo.d.ts" />
33
let y: number = Foo.fn();
44
>y : number
5-
>Foo.fn() : any
6-
>Foo.fn : any
7-
>Foo : any
8-
>fn : any
5+
>Foo.fn() : number
6+
>Foo.fn : () => number
7+
>Foo : typeof Foo
8+
>fn : () => number
99

1010
=== tests/cases/conformance/externalModules/foo.d.ts ===
1111

0 commit comments

Comments
 (0)