@@ -131,7 +131,7 @@ export class NativeScriptNgZone implements NgZone {
131131 }
132132
133133 Zone . assertZonePatched ( ) ;
134- const self = ( this as any ) as NgZonePrivate ;
134+ const self = this as any as NgZonePrivate ;
135135 self . _nesting = 0 ;
136136
137137 self . _outer = self . _inner = Zone . current ;
@@ -149,7 +149,8 @@ export class NativeScriptNgZone implements NgZone {
149149 self . shouldCoalesceRunChangeDetection = shouldCoalesceRunChangeDetection ;
150150 self . lastRequestAnimationFrameId = - 1 ;
151151 self . nativeRequestAnimationFrame = function ( cb ) {
152- Utils . dispatchToMainThread ( cb ) ;
152+ const nativeDispatchToMainThread = Utils [ Zone . __symbol__ ( 'dispatchToMainThread' ) ] || Utils . dispatchToMainThread ;
153+ nativeDispatchToMainThread ( cb ) ;
153154 return currentRafId ++ ;
154155 } ;
155156 forkInnerZoneWithAngularBehavior ( self ) ;
@@ -184,7 +185,7 @@ export class NativeScriptNgZone implements NgZone {
184185 * If a synchronous error happens it will be rethrown and not reported via `onError`.
185186 */
186187 run < T > ( fn : ( ...args : any [ ] ) => T , applyThis ?: any , applyArgs ?: any [ ] ) : T {
187- return ( ( this as any ) as NgZonePrivate ) . _inner . run ( fn , applyThis , applyArgs ) ;
188+ return ( this as any as NgZonePrivate ) . _inner . run ( fn , applyThis , applyArgs ) ;
188189 }
189190
190191 /**
@@ -200,7 +201,7 @@ export class NativeScriptNgZone implements NgZone {
200201 * If a synchronous error happens it will be rethrown and not reported via `onError`.
201202 */
202203 runTask < T > ( fn : ( ...args : any [ ] ) => T , applyThis ?: any , applyArgs ?: any [ ] , name ?: string ) : T {
203- const zone = ( ( this as any ) as NgZonePrivate ) . _inner ;
204+ const zone = ( this as any as NgZonePrivate ) . _inner ;
204205 const task = zone . scheduleEventTask ( 'NgZoneEvent: ' + name , fn , EMPTY_PAYLOAD , noop , noop ) ;
205206 try {
206207 return zone . runTask ( task , applyThis , applyArgs ) ;
@@ -214,7 +215,7 @@ export class NativeScriptNgZone implements NgZone {
214215 * rethrown.
215216 */
216217 runGuarded < T > ( fn : ( ...args : any [ ] ) => T , applyThis ?: any , applyArgs ?: any [ ] ) : T {
217- return ( ( this as any ) as NgZonePrivate ) . _inner . runGuarded ( fn , applyThis , applyArgs ) ;
218+ return ( this as any as NgZonePrivate ) . _inner . runGuarded ( fn , applyThis , applyArgs ) ;
218219 }
219220
220221 /**
@@ -231,7 +232,7 @@ export class NativeScriptNgZone implements NgZone {
231232 * Use {@link #run} to reenter the Angular zone and do work that updates the application model.
232233 */
233234 runOutsideAngular < T > ( fn : ( ...args : any [ ] ) => T ) : T {
234- return ( ( this as any ) as NgZonePrivate ) . _outer . run ( fn ) ;
235+ return ( this as any as NgZonePrivate ) . _outer . run ( fn ) ;
235236 }
236237}
237238
0 commit comments