Merge pull request #1547 from Microsoft/moveEmitHost

Moved EmitHost to utilities.ts so that it can be edited alone, and to fix resulting declaration file
This commit is contained in:
Daniel Rosenwasser 2015-01-07 13:13:49 -08:00
commit df4b3d2d37
2 changed files with 12 additions and 12 deletions

View file

@ -1461,18 +1461,7 @@ module ts {
referencePathsOutput,
}
}
export interface EmitHost extends ScriptReferenceHost {
getSourceFiles(): SourceFile[];
isEmitBlocked(sourceFile?: SourceFile): boolean;
getCommonSourceDirectory(): string;
getCanonicalFileName(fileName: string): string;
getNewLine(): string;
writeFile(filename: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void;
}
export function getDeclarationDiagnostics(host: EmitHost, resolver: EmitResolver, targetSourceFile: SourceFile): Diagnostic[] {
var diagnostics: Diagnostic[] = [];
var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, host, ".js");

View file

@ -23,6 +23,17 @@ module ts {
string(): string;
}
export interface EmitHost extends ScriptReferenceHost {
getSourceFiles(): SourceFile[];
isEmitBlocked(sourceFile?: SourceFile): boolean;
getCommonSourceDirectory(): string;
getCanonicalFileName(fileName: string): string;
getNewLine(): string;
writeFile(filename: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void;
}
// Pool writers to avoid needing to allocate them for every symbol we write.
var stringWriters: StringSymbolWriter[] = [];
export function getSingleLineStringWriter(): StringSymbolWriter {