mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Use existing function to resolve export= declarations
This commit is contained in:
@@ -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,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 ===
|
||||
|
||||
|
||||
@@ -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 ===
|
||||
|
||||
|
||||
Reference in New Issue
Block a user