Skip to content

Commit

Permalink
Use existing function to resolve export= declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanCavanaugh committed Mar 8, 2016
1 parent 56b3353 commit 5b510ce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
8 changes: 1 addition & 7 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions tests/baselines/reference/umd6.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -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 ===

Expand Down
8 changes: 4 additions & 4 deletions tests/baselines/reference/umd6.types
Original file line number Diff line number Diff line change
Expand Up @@ -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 ===

Expand Down

0 comments on commit 5b510ce

Please sign in to comment.