From 3cfe2817908be3a55a6e496a34bd0e5b98f8f1d4 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Tue, 3 May 2016 16:08:35 -0600 Subject: [PATCH] fix(tsickle): put the tsickle support code at EOF --- tools/compiler_cli/src/compiler_host.ts | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/tools/compiler_cli/src/compiler_host.ts b/tools/compiler_cli/src/compiler_host.ts index 6b04ce58c1..7d8dfab9df 100644 --- a/tools/compiler_cli/src/compiler_host.ts +++ b/tools/compiler_cli/src/compiler_host.ts @@ -4,11 +4,6 @@ import {convertDecorators} from 'tsickle'; import {NodeReflectorHost} from './reflector_host'; import {AngularCompilerOptions} from './codegen'; -const DEBUG = false; -function debug(msg: string, ...o: any[]) { - if (DEBUG) console.log(msg, ...o); -} - /** * Implementation of CompilerHost that forwards all methods to another instance. * Useful for partial implementations to override only methods they care about. @@ -37,11 +32,12 @@ export abstract class DelegatingHost implements ts.CompilerHost { export class TsickleHost extends DelegatingHost { // Additional diagnostics gathered by pre- and post-emit transformations. public diagnostics: ts.Diagnostic[] = []; - private TSICKLE_SUPPORT = `interface DecoratorInvocation { - type: Function; - args?: any[]; - } - `; + private TSICKLE_SUPPORT = ` +interface DecoratorInvocation { + type: Function; + args?: any[]; +} +`; constructor(delegate: ts.CompilerHost, private options: ts.CompilerOptions) { super(delegate); } getSourceFile = @@ -53,8 +49,7 @@ export class TsickleHost extends DelegatingHost { if (converted.diagnostics) { this.diagnostics.push(...converted.diagnostics); } - newContent = this.TSICKLE_SUPPORT + converted.output; - debug(newContent); + newContent = converted.output + this.TSICKLE_SUPPORT; } return ts.createSourceFile(fileName, newContent, languageVersion, true); }