@@ -39,18 +39,17 @@ export function registerPreOrderHooks(
3939
4040 if ( ngOnChanges as Function | undefined ) {
4141 const wrappedOnChanges = NgOnChangesFeatureImpl ( directiveDef ) ;
42- ( tView . preOrderHooks || ( tView . preOrderHooks = [ ] ) ) . push ( directiveIndex , wrappedOnChanges ) ;
43- ( tView . preOrderCheckHooks || ( tView . preOrderCheckHooks = [ ] ) )
44- . push ( directiveIndex , wrappedOnChanges ) ;
42+ ( tView . preOrderHooks ??= [ ] ) . push ( directiveIndex , wrappedOnChanges ) ;
43+ ( tView . preOrderCheckHooks ??= [ ] ) . push ( directiveIndex , wrappedOnChanges ) ;
4544 }
4645
4746 if ( ngOnInit ) {
48- ( tView . preOrderHooks || ( tView . preOrderHooks = [ ] ) ) . push ( 0 - directiveIndex , ngOnInit ) ;
47+ ( tView . preOrderHooks ?? = [ ] ) . push ( 0 - directiveIndex , ngOnInit ) ;
4948 }
5049
5150 if ( ngDoCheck ) {
52- ( tView . preOrderHooks || ( tView . preOrderHooks = [ ] ) ) . push ( directiveIndex , ngDoCheck ) ;
53- ( tView . preOrderCheckHooks || ( tView . preOrderCheckHooks = [ ] ) ) . push ( directiveIndex , ngDoCheck ) ;
51+ ( tView . preOrderHooks ?? = [ ] ) . push ( directiveIndex , ngDoCheck ) ;
52+ ( tView . preOrderCheckHooks ?? = [ ] ) . push ( directiveIndex , ngDoCheck ) ;
5453 }
5554}
5655
@@ -91,25 +90,25 @@ export function registerPostOrderHooks(tView: TView, tNode: TNode): void {
9190 } = lifecycleHooks ;
9291
9392 if ( ngAfterContentInit ) {
94- ( tView . contentHooks || ( tView . contentHooks = [ ] ) ) . push ( - i , ngAfterContentInit ) ;
93+ ( tView . contentHooks ?? = [ ] ) . push ( - i , ngAfterContentInit ) ;
9594 }
9695
9796 if ( ngAfterContentChecked ) {
98- ( tView . contentHooks || ( tView . contentHooks = [ ] ) ) . push ( i , ngAfterContentChecked ) ;
99- ( tView . contentCheckHooks || ( tView . contentCheckHooks = [ ] ) ) . push ( i , ngAfterContentChecked ) ;
97+ ( tView . contentHooks ?? = [ ] ) . push ( i , ngAfterContentChecked ) ;
98+ ( tView . contentCheckHooks ?? = [ ] ) . push ( i , ngAfterContentChecked ) ;
10099 }
101100
102101 if ( ngAfterViewInit ) {
103- ( tView . viewHooks || ( tView . viewHooks = [ ] ) ) . push ( - i , ngAfterViewInit ) ;
102+ ( tView . viewHooks ?? = [ ] ) . push ( - i , ngAfterViewInit ) ;
104103 }
105104
106105 if ( ngAfterViewChecked ) {
107- ( tView . viewHooks || ( tView . viewHooks = [ ] ) ) . push ( i , ngAfterViewChecked ) ;
108- ( tView . viewCheckHooks || ( tView . viewCheckHooks = [ ] ) ) . push ( i , ngAfterViewChecked ) ;
106+ ( tView . viewHooks ?? = [ ] ) . push ( i , ngAfterViewChecked ) ;
107+ ( tView . viewCheckHooks ?? = [ ] ) . push ( i , ngAfterViewChecked ) ;
109108 }
110109
111110 if ( ngOnDestroy != null ) {
112- ( tView . destroyHooks || ( tView . destroyHooks = [ ] ) ) . push ( i , ngOnDestroy ) ;
111+ ( tView . destroyHooks ?? = [ ] ) . push ( i , ngOnDestroy ) ;
113112 }
114113 }
115114}
0 commit comments