Skip to content

Commit 043b338

Browse files
committed
Add export = class scenario
1 parent 8cef251 commit 043b338

File tree

4 files changed

+88
-0
lines changed

4 files changed

+88
-0
lines changed

tests/baselines/reference/umd8.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//// [tests/cases/conformance/externalModules/umd8.ts] ////
2+
3+
//// [foo.d.ts]
4+
5+
declare class Thing {
6+
foo(): number;
7+
}
8+
export = Thing;
9+
export as namespace Foo;
10+
11+
//// [a.ts]
12+
/// <reference path="foo.d.ts" />
13+
let y: Foo;
14+
y.foo();
15+
16+
17+
18+
//// [a.js]
19+
/// <reference path="foo.d.ts" />
20+
var y;
21+
y.foo();
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
=== tests/cases/conformance/externalModules/a.ts ===
2+
/// <reference path="foo.d.ts" />
3+
let y: Foo;
4+
>y : Symbol(y, Decl(a.ts, 1, 3))
5+
>Foo : Symbol(Foo, Decl(foo.d.ts, 4, 15))
6+
7+
y.foo();
8+
>y.foo : Symbol(Foo.foo, Decl(foo.d.ts, 1, 21))
9+
>y : Symbol(y, Decl(a.ts, 1, 3))
10+
>foo : Symbol(Foo.foo, Decl(foo.d.ts, 1, 21))
11+
12+
13+
=== tests/cases/conformance/externalModules/foo.d.ts ===
14+
15+
declare class Thing {
16+
>Thing : Symbol(Thing, Decl(foo.d.ts, 0, 0))
17+
18+
foo(): number;
19+
>foo : Symbol(foo, Decl(foo.d.ts, 1, 21))
20+
}
21+
export = Thing;
22+
>Thing : Symbol(Thing, Decl(foo.d.ts, 0, 0))
23+
24+
export as namespace Foo;
25+

tests/baselines/reference/umd8.types

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
=== tests/cases/conformance/externalModules/a.ts ===
2+
/// <reference path="foo.d.ts" />
3+
let y: Foo;
4+
>y : Foo
5+
>Foo : Foo
6+
7+
y.foo();
8+
>y.foo() : number
9+
>y.foo : () => number
10+
>y : Foo
11+
>foo : () => number
12+
13+
14+
=== tests/cases/conformance/externalModules/foo.d.ts ===
15+
16+
declare class Thing {
17+
>Thing : Thing
18+
19+
foo(): number;
20+
>foo : () => number
21+
}
22+
export = Thing;
23+
>Thing : Thing
24+
25+
export as namespace Foo;
26+
>Foo : any
27+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// @module: commonjs
2+
// @noImplicitReferences: true
3+
4+
// @filename: foo.d.ts
5+
declare class Thing {
6+
foo(): number;
7+
}
8+
export = Thing;
9+
export as namespace Foo;
10+
11+
// @filename: a.ts
12+
/// <reference path="foo.d.ts" />
13+
let y: Foo;
14+
y.foo();
15+

0 commit comments

Comments
 (0)