Add module emit test

This commit is contained in:
Jason Freeman 2014-12-17 14:33:32 -08:00
parent ab33a65d30
commit 29dfa3d6c0
3 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,32 @@
//// [moduleSharesNameWithImportDeclarationInsideIt6.ts]
module Z.M {
export function bar() {
return "";
}
}
module A.M {
import M = Z.M;
export function bar() {
}
}
//// [moduleSharesNameWithImportDeclarationInsideIt6.js]
var Z;
(function (Z) {
var M;
(function (M) {
function bar() {
return "";
}
M.bar = bar;
})(M = Z.M || (Z.M = {}));
})(Z || (Z = {}));
var A;
(function (A) {
var M;
(function (M) {
function bar() {
}
M.bar = bar;
})(M = A.M || (A.M = {}));
})(A || (A = {}));

View File

@ -0,0 +1,24 @@
=== tests/cases/compiler/moduleSharesNameWithImportDeclarationInsideIt6.ts ===
module Z.M {
>Z : typeof Z
>M : typeof M
export function bar() {
>bar : () => string
return "";
}
}
module A.M {
>A : typeof A
>M : typeof A.M
import M = Z.M;
>M : typeof M
>Z : typeof Z
>M : typeof M
export function bar() {
>bar : () => void
}
}

View File

@ -0,0 +1,10 @@
module Z.M {
export function bar() {
return "";
}
}
module A.M {
import M = Z.M;
export function bar() {
}
}