Simplify module kind selection

This commit is contained in:
Mohamed Hegazy
2015-03-12 00:18:20 -07:00
parent 8c26507bd5
commit 3ed8bcc179
3 changed files with 47 additions and 53 deletions

View File

@@ -5413,14 +5413,14 @@ module ts {
extendsEmitted = true;
}
if (isExternalModule(node)) {
if (compilerOptions.module === ModuleKind.AMD) {
if (compilerOptions.target >= ScriptTarget.ES6) {
emitES6Module(node, startIndex);
}
else if (compilerOptions.module === ModuleKind.AMD) {
emitAMDModule(node, startIndex);
}
else if (compilerOptions.module === ModuleKind.CommonJS || compilerOptions.target < ScriptTarget.ES6) {
emitCommonJSModule(node, startIndex);
}
else {
emitES6Module(node, startIndex);
emitCommonJSModule(node, startIndex);
}
}
else {