-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10354 from RyanCavanaugh/fix9771
First in UMD global wins
- Loading branch information
Showing
5 changed files
with
103 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//// [tests/cases/compiler/umdGlobalConflict.ts] //// | ||
|
||
//// [index.d.ts] | ||
export as namespace Alpha; | ||
export var x: string; | ||
|
||
//// [index.d.ts] | ||
export as namespace Alpha; | ||
export var y: number; | ||
|
||
//// [consumer.ts] | ||
import * as v1 from './v1'; | ||
import * as v2 from './v2'; | ||
|
||
//// [global.ts] | ||
// Should be OK, first in wins | ||
const p: string = Alpha.x; | ||
|
||
//// [consumer.js] | ||
"use strict"; | ||
//// [global.js] | ||
// Should be OK, first in wins | ||
var p = Alpha.x; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
=== tests/cases/compiler/v1/index.d.ts === | ||
export as namespace Alpha; | ||
>Alpha : Symbol(Alpha, Decl(index.d.ts, 0, 0)) | ||
|
||
export var x: string; | ||
>x : Symbol(x, Decl(index.d.ts, 1, 10)) | ||
|
||
=== tests/cases/compiler/v2/index.d.ts === | ||
export as namespace Alpha; | ||
>Alpha : Symbol(Alpha, Decl(index.d.ts, 0, 0)) | ||
|
||
export var y: number; | ||
>y : Symbol(y, Decl(index.d.ts, 1, 10)) | ||
|
||
=== tests/cases/compiler/consumer.ts === | ||
import * as v1 from './v1'; | ||
>v1 : Symbol(v1, Decl(consumer.ts, 0, 6)) | ||
|
||
import * as v2 from './v2'; | ||
>v2 : Symbol(v2, Decl(consumer.ts, 1, 6)) | ||
|
||
=== tests/cases/compiler/global.ts === | ||
// Should be OK, first in wins | ||
const p: string = Alpha.x; | ||
>p : Symbol(p, Decl(global.ts, 1, 5)) | ||
>Alpha.x : Symbol(Alpha.x, Decl(index.d.ts, 1, 10)) | ||
>Alpha : Symbol(Alpha, Decl(index.d.ts, 0, 0)) | ||
>x : Symbol(Alpha.x, Decl(index.d.ts, 1, 10)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
=== tests/cases/compiler/v1/index.d.ts === | ||
export as namespace Alpha; | ||
>Alpha : typeof Alpha | ||
|
||
export var x: string; | ||
>x : string | ||
|
||
=== tests/cases/compiler/v2/index.d.ts === | ||
export as namespace Alpha; | ||
>Alpha : typeof | ||
|
||
export var y: number; | ||
>y : number | ||
|
||
=== tests/cases/compiler/consumer.ts === | ||
import * as v1 from './v1'; | ||
>v1 : typeof v1 | ||
|
||
import * as v2 from './v2'; | ||
>v2 : typeof v2 | ||
|
||
=== tests/cases/compiler/global.ts === | ||
// Should be OK, first in wins | ||
const p: string = Alpha.x; | ||
>p : string | ||
>Alpha.x : string | ||
>Alpha : typeof Alpha | ||
>x : string | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//@filename: v1/index.d.ts | ||
export as namespace Alpha; | ||
export var x: string; | ||
|
||
//@filename: v2/index.d.ts | ||
export as namespace Alpha; | ||
export var y: number; | ||
|
||
//@filename: consumer.ts | ||
import * as v1 from './v1'; | ||
import * as v2 from './v2'; | ||
|
||
//@filename: global.ts | ||
// Should be OK, first in wins | ||
const p: string = Alpha.x; |