refactor(compiler): remove unused `subscriptions` in view

This commit is contained in:
Tobias Bosch 2016-10-31 09:40:29 -07:00 committed by vsavkin
parent 1de04b23b1
commit 97471d74b6
3 changed files with 3 additions and 11 deletions

View File

@ -49,7 +49,6 @@ export class CompileView implements NameResolver {
public fields: o.ClassField[] = [];
public getters: o.ClassGetter[] = [];
public disposables: o.Expression[] = [];
public subscriptions: o.Expression[] = [];
public componentView: CompileView;
public purePipes = new Map<string, CompilePipe>();

View File

@ -541,8 +541,8 @@ function generateCreateMethod(view: CompileView): o.Statement[] {
'init',
[
createFlatArray(view.rootNodesOrAppElements),
o.literalArr(view.nodes.map(node => node.renderNode)), o.literalArr(view.disposables),
o.literalArr(view.subscriptions)
o.literalArr(view.nodes.map(node => node.renderNode)),
o.literalArr(view.disposables),
])
.toStmt(),
new o.ReturnStatement(resultExpr)

View File

@ -33,7 +33,6 @@ export abstract class AppView<T> {
rootNodesOrAppElements: any[];
allNodes: any[];
disposables: Function[];
subscriptions: any[];
contentChildren: AppView<any>[] = [];
viewChildren: AppView<any>[] = [];
viewContainerElement: AppElement = null;
@ -98,13 +97,10 @@ export abstract class AppView<T> {
*/
createInternal(rootSelectorOrNode: string|any): AppElement { return null; }
init(
rootNodesOrAppElements: any[], allNodes: any[], disposables: Function[],
subscriptions: any[]) {
init(rootNodesOrAppElements: any[], allNodes: any[], disposables: Function[]) {
this.rootNodesOrAppElements = rootNodesOrAppElements;
this.allNodes = allNodes;
this.disposables = disposables;
this.subscriptions = subscriptions;
if (this.type === ViewType.COMPONENT) {
// Note: the render nodes have been attached to their host element
// in the ViewFactory already.
@ -164,9 +160,6 @@ export abstract class AppView<T> {
for (var i = 0; i < this.disposables.length; i++) {
this.disposables[i]();
}
for (var i = 0; i < this.subscriptions.length; i++) {
this.subscriptions[i].unsubscribe();
}
this.destroyInternal();
this.dirtyParentQueriesInternal();