From cc8f5a6499aab248034045cbe3b6de9d1d4a84a9 Mon Sep 17 00:00:00 2001 From: Max Heiber Date: Fri, 19 Apr 2019 18:11:27 +0100 Subject: [PATCH] fix 31012 allow noEmitOnError with isolatedModules fix #31012 Since the purpose of isolatedModules: true is to do extra validation to ensure that separate compilation is safe Allowing emit in the presence of errors is compatible with that intention. Signed-off-by: Max Heiber --- src/compiler/program.ts | 4 ---- .../reference/isolatedModulesNoEmitOnError.errors.txt | 6 ------ tests/baselines/reference/isolatedModulesNoEmitOnError.js | 5 +++++ 3 files changed, 5 insertions(+), 10 deletions(-) delete mode 100644 tests/baselines/reference/isolatedModulesNoEmitOnError.errors.txt create mode 100644 tests/baselines/reference/isolatedModulesNoEmitOnError.js diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 4f50aa3ab1f59..85290ab6eb73b 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -2707,10 +2707,6 @@ namespace ts { createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, getEmitDeclarationOptionName(options), "isolatedModules"); } - if (options.noEmitOnError) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noEmitOnError", "isolatedModules"); - } - if (options.out) { createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", "isolatedModules"); } diff --git a/tests/baselines/reference/isolatedModulesNoEmitOnError.errors.txt b/tests/baselines/reference/isolatedModulesNoEmitOnError.errors.txt deleted file mode 100644 index 34ff251c16701..0000000000000 --- a/tests/baselines/reference/isolatedModulesNoEmitOnError.errors.txt +++ /dev/null @@ -1,6 +0,0 @@ -error TS5053: Option 'noEmitOnError' cannot be specified with option 'isolatedModules'. - - -!!! error TS5053: Option 'noEmitOnError' cannot be specified with option 'isolatedModules'. -==== tests/cases/compiler/file1.ts (0 errors) ==== - export var x; \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesNoEmitOnError.js b/tests/baselines/reference/isolatedModulesNoEmitOnError.js new file mode 100644 index 0000000000000..2963a9d694fbf --- /dev/null +++ b/tests/baselines/reference/isolatedModulesNoEmitOnError.js @@ -0,0 +1,5 @@ +//// [file1.ts] +export var x; + +//// [file1.js] +export var x;