rename tests, add another test, reoslve symbols for comparison

This commit is contained in:
Wesley Wigham
2015-11-30 12:44:13 -08:00
parent 54ab1e99c0
commit d3f2f55ae8
9 changed files with 87 additions and 2 deletions

View File

@@ -1113,7 +1113,7 @@ namespace ts {
};
}
}
else if (lookupTable && exportNode && id !== "default" && hasProperty(target, id) && target[id] !== source[id]) {
else if (lookupTable && exportNode && id !== "default" && hasProperty(target, id) && resolveSymbol(target[id]) !== resolveSymbol(source[id])) {
lookupTable[id].exportsWithDuplicate.push(exportNode);
}
}

View File

@@ -1,4 +1,4 @@
//// [tests/cases/compiler/moduleSameValueDuplicateExportedBindings.ts] ////
//// [tests/cases/compiler/moduleSameValueDuplicateExportedBindings1.ts] ////
//// [a.ts]
export * from "./b";

View File

@@ -0,0 +1,34 @@
//// [tests/cases/compiler/moduleSameValueDuplicateExportedBindings2.ts] ////
//// [a.ts]
export * from "./b";
export * from "./c";
//// [b.ts]
export {Animals} from "./c";
//// [c.ts]
export enum Animals {
Cat,
Dog
};
//// [c.js]
"use strict";
(function (Animals) {
Animals[Animals["Cat"] = 0] = "Cat";
Animals[Animals["Dog"] = 1] = "Dog";
})(exports.Animals || (exports.Animals = {}));
var Animals = exports.Animals;
;
//// [b.js]
"use strict";
var c_1 = require("./c");
exports.Animals = c_1.Animals;
//// [a.js]
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
__export(require("./b"));
__export(require("./c"));

View File

@@ -0,0 +1,19 @@
=== tests/cases/compiler/a.ts ===
export * from "./b";
No type information for this code.export * from "./c";
No type information for this code.
No type information for this code.=== tests/cases/compiler/b.ts ===
export {Animals} from "./c";
>Animals : Symbol(Animals, Decl(b.ts, 0, 8))
=== tests/cases/compiler/c.ts ===
export enum Animals {
>Animals : Symbol(Animals, Decl(c.ts, 0, 0))
Cat,
>Cat : Symbol(Animals.Cat, Decl(c.ts, 0, 21))
Dog
>Dog : Symbol(Animals.Dog, Decl(c.ts, 1, 5))
};

View File

@@ -0,0 +1,19 @@
=== tests/cases/compiler/a.ts ===
export * from "./b";
No type information for this code.export * from "./c";
No type information for this code.
No type information for this code.=== tests/cases/compiler/b.ts ===
export {Animals} from "./c";
>Animals : typeof Animals
=== tests/cases/compiler/c.ts ===
export enum Animals {
>Animals : Animals
Cat,
>Cat : Animals
Dog
>Dog : Animals
};

View File

@@ -0,0 +1,13 @@
// @module: commonjs
// @filename: a.ts
export * from "./b";
export * from "./c";
// @filename: b.ts
export {Animals} from "./c";
// @filename: c.ts
export enum Animals {
Cat,
Dog
};