@@ -93,14 +93,14 @@ export class NgZone {
9393 _onErrorHandler : ( error : any , stack : any ) => void ;
9494
9595 // Number of microtasks pending from _innerZone (& descendants)
96- _pendingMicrotasks : number ;
96+ _pendingMicrotasks : number = 0 ;
9797 // Whether some code has been executed in the _innerZone (& descendants) in the current turn
98- _hasExecutedCodeInInnerZone : boolean ;
98+ _hasExecutedCodeInInnerZone : boolean = false ;
9999 // run() call depth in _mountZone. 0 at the end of a macrotask
100100 // zone.run(() => { // top-level call
101101 // zone.run(() => {}); // nested call -> in-turn
102102 // });
103- _nestedRun : number ;
103+ _nestedRun : number = 0 ;
104104
105105 // TODO(vicb): implement this class properly for node.js environment
106106 // This disabled flag is only here to please cjs tests
@@ -115,15 +115,6 @@ export class NgZone {
115115 * enabled in development mode as they significantly impact perf.
116116 */
117117 constructor ( { enableLongStackTrace} ) {
118- this . _onTurnStart = null ;
119- this . _onTurnDone = null ;
120- this . _onEventDone = null ;
121- this . _onErrorHandler = null ;
122-
123- this . _pendingMicrotasks = 0 ;
124- this . _hasExecutedCodeInInnerZone = false ;
125- this . _nestedRun = 0 ;
126-
127118 if ( global . zone ) {
128119 this . _disabled = false ;
129120 this . _mountZone = global . zone ;
@@ -142,7 +133,7 @@ export class NgZone {
142133 *
143134 * Setting the hook overrides any previously set hook.
144135 */
145- overrideOnTurnStart ( onTurnStartHook : Function ) : void {
136+ overrideOnTurnStart ( onTurnStartHook : ( ) => void ) : void {
146137 this . _onTurnStart = normalizeBlank ( onTurnStartHook ) ;
147138 }
148139
@@ -156,7 +147,7 @@ export class NgZone {
156147 *
157148 * Setting the hook overrides any previously set hook.
158149 */
159- overrideOnTurnDone ( onTurnDoneHook : Function ) : void {
150+ overrideOnTurnDone ( onTurnDoneHook : ( ) => void ) : void {
160151 this . _onTurnDone = normalizeBlank ( onTurnDoneHook ) ;
161152 }
162153
@@ -171,7 +162,7 @@ export class NgZone {
171162 *
172163 * Setting the hook overrides any previously set hook.
173164 */
174- overrideOnEventDone ( onEventDoneFn : Function , opt_waitForAsync : boolean = false ) : void {
165+ overrideOnEventDone ( onEventDoneFn : ( ) => void , opt_waitForAsync : boolean = false ) : void {
175166 var normalizedOnEventDone = normalizeBlank ( onEventDoneFn ) ;
176167 if ( opt_waitForAsync ) {
177168 this . _onEventDone = ( ) => {
@@ -242,7 +233,7 @@ export class NgZone {
242233 var errorHandling ;
243234
244235 if ( enableLongStackTrace ) {
245- errorHandling = StringMapWrapper . merge ( < any > Zone . longStackTraceZone ,
236+ errorHandling = StringMapWrapper . merge ( Zone . longStackTraceZone ,
246237 { onError : function ( e ) { ngZone . _onError ( this , e ) ; } } ) ;
247238 } else {
248239 errorHandling = { onError : function ( e ) { ngZone . _onError ( this , e ) ; } } ;
0 commit comments