-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a050ea
commit b3a91d6
Showing
26 changed files
with
503 additions
and
11 deletions.
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
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
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
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
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,21 @@ | ||
//// [tests/cases/conformance/externalModules/umd1.ts] //// | ||
|
||
//// [foo.d.ts] | ||
|
||
export var x: number; | ||
export function fn(): void; | ||
export interface Thing { n: typeof x } | ||
declare global export Foo; | ||
|
||
//// [a.ts] | ||
/// <reference path="foo.d.ts" /> | ||
Foo.fn(); | ||
let x: Foo.Thing; | ||
let y: number = x.n; | ||
|
||
|
||
//// [a.js] | ||
/// <reference path="foo.d.ts" /> | ||
exports.Foo.fn(); | ||
var x; | ||
var y = x.n; |
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,33 @@ | ||
=== tests/cases/conformance/externalModules/a.ts === | ||
/// <reference path="foo.d.ts" /> | ||
Foo.fn(); | ||
>Foo.fn : Symbol(Foo.fn, Decl(foo.d.ts, 1, 21)) | ||
>Foo : Symbol(Foo, Decl(foo.d.ts, 3, 38)) | ||
>fn : Symbol(Foo.fn, Decl(foo.d.ts, 1, 21)) | ||
|
||
let x: Foo.Thing; | ||
>x : Symbol(x, Decl(a.ts, 2, 3)) | ||
>Foo : Symbol(Foo, Decl(foo.d.ts, 3, 38)) | ||
>Thing : Symbol(Foo.Thing, Decl(foo.d.ts, 2, 27)) | ||
|
||
let y: number = x.n; | ||
>y : Symbol(y, Decl(a.ts, 3, 3)) | ||
>x.n : Symbol(Foo.Thing.n, Decl(foo.d.ts, 3, 24)) | ||
>x : Symbol(x, Decl(a.ts, 2, 3)) | ||
>n : Symbol(Foo.Thing.n, Decl(foo.d.ts, 3, 24)) | ||
|
||
=== tests/cases/conformance/externalModules/foo.d.ts === | ||
|
||
export var x: number; | ||
>x : Symbol(x, Decl(foo.d.ts, 1, 10)) | ||
|
||
export function fn(): void; | ||
>fn : Symbol(fn, Decl(foo.d.ts, 1, 21)) | ||
|
||
export interface Thing { n: typeof x } | ||
>Thing : Symbol(Thing, Decl(foo.d.ts, 2, 27)) | ||
>n : Symbol(n, Decl(foo.d.ts, 3, 24)) | ||
>x : Symbol(x, Decl(foo.d.ts, 1, 10)) | ||
|
||
declare global export Foo; | ||
|
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,35 @@ | ||
=== tests/cases/conformance/externalModules/a.ts === | ||
/// <reference path="foo.d.ts" /> | ||
Foo.fn(); | ||
>Foo.fn() : void | ||
>Foo.fn : () => void | ||
>Foo : typeof Foo | ||
>fn : () => void | ||
|
||
let x: Foo.Thing; | ||
>x : Foo.Thing | ||
>Foo : any | ||
>Thing : Foo.Thing | ||
|
||
let y: number = x.n; | ||
>y : number | ||
>x.n : number | ||
>x : Foo.Thing | ||
>n : number | ||
|
||
=== tests/cases/conformance/externalModules/foo.d.ts === | ||
|
||
export var x: number; | ||
>x : number | ||
|
||
export function fn(): void; | ||
>fn : () => void | ||
|
||
export interface Thing { n: typeof x } | ||
>Thing : Thing | ||
>n : number | ||
>x : number | ||
|
||
declare global export Foo; | ||
>Foo : any | ||
|
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,19 @@ | ||
tests/cases/conformance/externalModules/a.ts(1,1): error TS2304: Cannot find name 'Foo'. | ||
tests/cases/conformance/externalModules/a.ts(2,8): error TS2503: Cannot find namespace 'Foo'. | ||
|
||
|
||
==== tests/cases/conformance/externalModules/a.ts (2 errors) ==== | ||
Foo.fn(); | ||
~~~ | ||
!!! error TS2304: Cannot find name 'Foo'. | ||
let x: Foo.Thing; | ||
~~~ | ||
!!! error TS2503: Cannot find namespace 'Foo'. | ||
let y: number = x.n; | ||
|
||
==== tests/cases/conformance/externalModules/foo.d.ts (0 errors) ==== | ||
|
||
export var x: number; | ||
export function fn(): void; | ||
declare global export Foo; | ||
|
Oops, something went wrong.