Don't emit outputs when -noEmit is specified.

This commit is contained in:
Arnavion
2014-12-16 20:25:19 -08:00
parent dbe5cd0459
commit cd6eb180c6
3 changed files with 5 additions and 2 deletions

View File

@@ -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();

View File

@@ -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

View File

@@ -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