8000 UMD support by RyanCavanaugh · Pull Request #7264 · microsoft/TypeScript · GitHub
[go: up one dir, main page]

Skip to content

UMD support #7264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 10, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use existing function to resolve export= declarations
  • Loading branch information
RyanCavanaugh committed Mar 9, 2016
commit 2875326735c810a3e8b43c9c52e3bcb603d33efc
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