Simplify the API for emitting code from the Program instance.

This commit is contained in:
Cyrus Najmabadi
2015-02-04 16:53:14 -08:00
parent b6d083fa40
commit bb307f8163
19 changed files with 263 additions and 152 deletions
+1 -1
View File
@@ -2216,7 +2216,7 @@ module FourSlash {
if (errors.length > 0) {
throw new Error('Error compiling ' + fileName + ': ' + errors.map(e => e.messageText).join('\r\n'));
}
program.emitFiles();
program.emit();
result = result || ''; // Might have an empty fourslash file
// Compile and execute the test
+1 -1
View File
@@ -1086,7 +1086,7 @@ module Harness {
// only emit if there weren't parse errors
var emitResult: ts.EmitResult;
if (!isEmitBlocked) {
emitResult = program.emitFiles();
emitResult = program.emit();
}
var errors: HarnessDiagnostic[] = [];
+1 -1
View File
@@ -131,7 +131,7 @@ class ProjectRunner extends RunnerBase {
var sourceMapData: ts.SourceMapData[] = null;
if (!errors.length) {
errors = program.getTypeCheckerDiagnostics();
var emitResult = program.emitFiles();
var emitResult = program.emit();
errors = ts.concatenate(errors, emitResult.diagnostics);
sourceMapData = emitResult.sourceMaps;