Simplify the API for emitting and reporting exit statuses to callers.

This commit is contained in:
Cyrus Najmabadi
2015-02-05 15:50:18 -08:00
parent e7f6693eda
commit 66a363f449
42 changed files with 199 additions and 260 deletions

View File

@@ -174,20 +174,20 @@ module ts {
// If the noEmitOnError flag is set, then check if we have any errors so far. If so,
// immediately bail out.
if (options.noEmitOnError && getPreEmitDiagnostics(this).length > 0) {
return { diagnostics: [], sourceMaps: undefined, emitResultStatus: EmitReturnStatus.DiagnosticsPresent_AllOutputsSkipped };
return { diagnostics: [], sourceMaps: undefined, emitSkipped: true };
}
var start = new Date().getTime();
var result = emitFiles(
var emitResult = emitFiles(
getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile),
getEmitHost(writeFileCallback),
sourceFile);
emitTime += new Date().getTime() - start;
return result;
return emitResult;
}
function getSourceFile(fileName: string) {
fileName = host.getCanonicalFileName(fileName);
return hasProperty(filesByName, fileName) ? filesByName[fileName] : undefined;