Use existing function to resolve export= declarations

This commit is contained in:
Ryan Cavanaugh
2016-03-09 10:08:24 -08:00
parent 3d948be4c6
commit 2875326735
3 changed files with 7 additions and 11 deletions
+1 -7
View File
@@ -982,13 +982,7 @@ namespace ts {
}
function getTargetOfGlobalModuleExportDeclaration(node: GlobalModuleExportDeclaration): Symbol {
const moduleSymbol = node.parent.symbol;
if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports["export="]) {
return getMergedSymbol(moduleSymbol.exports["export="].exportSymbol);
}
else {
return getMergedSymbol(moduleSymbol);
}
return resolveExternalModuleSymbol(node.parent.symbol);
}
function getTargetOfExportSpecifier(node: ExportSpecifier): Symbol {
+2
View File
@@ -2,7 +2,9 @@
/// <reference path="foo.d.ts" />
let y: number = Foo.fn();
>y : Symbol(y, Decl(a.ts, 1, 3))
>Foo.fn : Symbol(Foo.fn, Decl(foo.d.ts, 1, 25))
>Foo : Symbol(Foo, Decl(foo.d.ts, 4, 15))
>fn : Symbol(Foo.fn, Decl(foo.d.ts, 1, 25))
=== tests/cases/conformance/externalModules/foo.d.ts ===
+4 -4
View File
@@ -2,10 +2,10 @@
/// <reference path="foo.d.ts" />
let y: number = Foo.fn();
>y : number
>Foo.fn() : any
>Foo.fn : any
>Foo : any
>fn : any
>Foo.fn() : number
>Foo.fn : () => number
>Foo : typeof Foo
>fn : () => number
=== tests/cases/conformance/externalModules/foo.d.ts ===