Skip to content

Commit 3cfe281

Browse files
alexeagletbosch
authored andcommitted
fix(tsickle): put the tsickle support code at EOF
1 parent 6eac4b6 commit 3cfe281

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

tools/compiler_cli/src/compiler_host.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ import {convertDecorators} from 'tsickle';
44
import {NodeReflectorHost} from './reflector_host';
55
import {AngularCompilerOptions} from './codegen';
66

7-
const DEBUG = false;
8-
function debug(msg: string, ...o: any[]) {
9-
if (DEBUG) console.log(msg, ...o);
10-
}
11-
127
/**
138
* Implementation of CompilerHost that forwards all methods to another instance.
149
* Useful for partial implementations to override only methods they care about.
@@ -37,11 +32,12 @@ export abstract class DelegatingHost implements ts.CompilerHost {
3732
export class TsickleHost extends DelegatingHost {
3833
// Additional diagnostics gathered by pre- and post-emit transformations.
3934
public diagnostics: ts.Diagnostic[] = [];
40-
private TSICKLE_SUPPORT = `interface DecoratorInvocation {
41-
type: Function;
42-
args?: any[];
43-
}
44-
`;
35+
private TSICKLE_SUPPORT = `
36+
interface DecoratorInvocation {
37+
type: Function;
38+
args?: any[];
39+
}
40+
`;
4541
constructor(delegate: ts.CompilerHost, private options: ts.CompilerOptions) { super(delegate); }
4642

4743
getSourceFile =
@@ -53,8 +49,7 @@ export class TsickleHost extends DelegatingHost {
5349
if (converted.diagnostics) {
5450
this.diagnostics.push(...converted.diagnostics);
5551
}
56-
newContent = this.TSICKLE_SUPPORT + converted.output;
57-
debug(newContent);
52+
newContent = converted.output + this.TSICKLE_SUPPORT;
5853
}
5954
return ts.createSourceFile(fileName, newContent, languageVersion, true);
6055
}

0 commit comments

Comments
 (0)