fix(core): size regression with closure compiler (#25531)

By pulling in `compiler` into `core` the `compiler` was not
100% tree-shakable and about  8KB of code was retained
when tree-shaken with closure.

PR Close #25531
This commit is contained in:
Miško Hevery
2018-08-16 14:37:21 -07:00
committed by Misko Hevery
parent 371df35624
commit 1f59f2f04d
6 changed files with 123 additions and 99 deletions

View File

@ -1078,8 +1078,14 @@ export class BindingScope implements LocalResolver {
private map = new Map<string, BindingData>();
private referenceNameIndex = 0;
private restoreViewVariable: o.ReadVarExpr|null = null;
private static _ROOT_SCOPE: BindingScope;
static ROOT_SCOPE = new BindingScope().set(0, '$event', o.variable('$event'));
static get ROOT_SCOPE(): BindingScope {
if (!BindingScope._ROOT_SCOPE) {
BindingScope._ROOT_SCOPE = new BindingScope().set(0, '$event', o.variable('$event'));
}
return BindingScope._ROOT_SCOPE;
}
private constructor(public bindingLevel: number = 0, private parent: BindingScope|null = null) {}