Merge pull request #9042 from Microsoft/ES6ModulesES5Target

Fix #6319: Add support for `--t: es5` and  `--m es6`
This commit is contained in:
Mohamed Hegazy
2016-06-10 10:23:39 -07:00
committed by GitHub
50 changed files with 850 additions and 32 deletions

View File

@@ -2160,11 +2160,6 @@ namespace ts {
programDiagnostics.add(createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none));
}
// Cannot specify module gen target of es6 when below es6
if (options.module === ModuleKind.ES6 && languageVersion < ScriptTarget.ES6) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_compile_modules_into_es2015_when_targeting_ES5_or_lower));
}
// Cannot specify module gen that isn't amd or system with --out
if (outFile) {
if (options.module && !(options.module === ModuleKind.AMD || options.module === ModuleKind.System)) {