diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index bc4d48b7513..32725bfe0fc 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -296,6 +296,9 @@ module ts { if (checker.isEmitBlocked()) { exitStatus = EmitReturnStatus.AllOutputGenerationSkipped; } + else if (compilerOptions.noEmit) { + exitStatus = EmitReturnStatus.Succeeded; + } else { var emitStart = new Date().getTime(); var emitOutput = checker.emitFiles(); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 9ed58746922..c44c148c6ae 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -943,7 +943,7 @@ module ts { // Return code used by getEmitOutput function to indicate status of the function export enum EmitReturnStatus { - Succeeded = 0, // All outputs generated as requested (.js, .map, .d.ts), no errors reported + Succeeded = 0, // All outputs generated if requested (.js, .map, .d.ts), no errors reported AllOutputGenerationSkipped = 1, // No .js generated because of syntax errors, nothing generated JSGeneratedWithSemanticErrors = 2, // .js and .map generated with semantic errors DeclarationGenerationSkipped = 3, // .d.ts generation skipped because of semantic errors or declaration emitter specific errors; Output .js with semantic errors diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index f5a582868e5..9ad1734178d 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -34,7 +34,7 @@ declare var FourSlash; // Return code used by getEmitOutput function to indicate status of the function // It is a duplicate of the one in types.ts to expose it to testcases in fourslash enum EmitReturnStatus { - Succeeded = 0, // All outputs generated as requested (.js, .map, .d.ts), no errors reported + Succeeded = 0, // All outputs generated if requested (.js, .map, .d.ts), no errors reported AllOutputGenerationSkipped = 1, // No .js generated because of syntax errors, or compiler options errors, nothing generated JSGeneratedWithSemanticErrors = 2, // .js and .map generated with semantic errors DeclarationGenerationSkipped = 3, // .d.ts generation skipped because of semantic errors or declaration emitter specific errors; Output .js with semantic errors