From d907f99693aac97f714fef0c72af433326ad681a Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 22 Dec 2014 13:58:14 -0800 Subject: [PATCH 1/3] Moved EmitHost to types.ts so that utilities can be edited as a standalone file through dependency resolution. --- src/compiler/emitter.ts | 13 +------------ src/compiler/types.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 237f3ab509a..1065a1e0e60 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -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"); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index cc1b37aef5d..f95200c4cb3 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -951,6 +951,18 @@ module ts { isEmitBlocked(sourceFile?: SourceFile): boolean; } + 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 interface SourceMapSpan { emittedLine: number; // Line number in the .js file emittedColumn: number; // Column number in the .js file From 8aefbe9a86999654a0b4858ecf6db9a13cd37ac0 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 22 Dec 2014 14:02:40 -0800 Subject: [PATCH 2/3] Removed newline. --- src/compiler/types.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index f95200c4cb3..dbdd71ed363 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -962,7 +962,6 @@ module ts { writeFile(filename: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; } - export interface SourceMapSpan { emittedLine: number; // Line number in the .js file emittedColumn: number; // Column number in the .js file From 06d65c797d91816d4c7b5bfe4f25ee1c01dd9691 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 7 Jan 2015 12:37:46 -0800 Subject: [PATCH 3/3] Moved EmitHost to utilities.ts --- src/compiler/types.ts | 11 ----------- src/compiler/utilities.ts | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index dbdd71ed363..cc1b37aef5d 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -951,17 +951,6 @@ module ts { isEmitBlocked(sourceFile?: SourceFile): boolean; } - 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 interface SourceMapSpan { emittedLine: number; // Line number in the .js file emittedColumn: number; // Column number in the .js file diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index edd8bf156cf..9686622decb 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -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 {