Skip to content

Commit df4b3d2

Browse files
Merge pull request microsoft#1547 from Microsoft/moveEmitHost
Moved EmitHost to utilities.ts so that it can be edited alone, and to fix resulting declaration file
2 parents 4daa107 + 06d65c7 commit df4b3d2

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/compiler/emitter.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,18 +1461,7 @@ module ts {
14611461
referencePathsOutput,
14621462
}
14631463
}
1464-
1465-
export interface EmitHost extends ScriptReferenceHost {
1466-
getSourceFiles(): SourceFile[];
1467-
isEmitBlocked(sourceFile?: SourceFile): boolean;
1468-
1469-
getCommonSourceDirectory(): string;
1470-
getCanonicalFileName(fileName: string): string;
1471-
getNewLine(): string;
1472-
1473-
writeFile(filename: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void;
1474-
}
1475-
1464+
14761465
export function getDeclarationDiagnostics(host: EmitHost, resolver: EmitResolver, targetSourceFile: SourceFile): Diagnostic[] {
14771466
var diagnostics: Diagnostic[] = [];
14781467
var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, host, ".js");

src/compiler/utilities.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ module ts {
2323
string(): string;
2424
}
2525

26+
export interface EmitHost extends ScriptReferenceHost {
27+
getSourceFiles(): SourceFile[];
28+
isEmitBlocked(sourceFile?: SourceFile): boolean;
29+
30+
getCommonSourceDirectory(): string;
31+
getCanonicalFileName(fileName: string): string;
32+
getNewLine(): string;
33+
34+
writeFile(filename: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void;
35+
}
36+
2637
// Pool writers to avoid needing to allocate them for every symbol we write.
2738
var stringWriters: StringSymbolWriter[] = [];
2839
export function getSingleLineStringWriter(): StringSymbolWriter {

0 commit comments

Comments
 (0)