@@ -131,7 +131,7 @@ export class NativeScriptNgZone implements NgZone {
131
131
}
132
132
133
133
Zone . assertZonePatched ( ) ;
134
- const self = ( this as any ) as NgZonePrivate ;
134
+ const self = this as any as NgZonePrivate ;
135
135
self . _nesting = 0 ;
136
136
137
137
self . _outer = self . _inner = Zone . current ;
@@ -149,7 +149,8 @@ export class NativeScriptNgZone implements NgZone {
149
149
self . shouldCoalesceRunChangeDetection = shouldCoalesceRunChangeDetection ;
150
150
self . lastRequestAnimationFrameId = - 1 ;
151
151
self . nativeRequestAnimationFrame = function ( cb ) {
152
- Utils . dispatchToMainThread ( cb ) ;
152
+ const nativeDispatchToMainThread = Utils [ Zone . __symbol__ ( 'dispatchToMainThread' ) ] || Utils . dispatchToMainThread ;
153
+ nativeDispatchToMainThread ( cb ) ;
153
154
return currentRafId ++ ;
154
155
} ;
155
156
forkInnerZoneWithAngularBehavior ( self ) ;
@@ -184,7 +185,7 @@ export class NativeScriptNgZone implements NgZone {
184
185
* If a synchronous error happens it will be rethrown and not reported via `onError`.
185
186
*/
186
187
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 ) ;
188
189
}
189
190
190
191
/**
@@ -200,7 +201,7 @@ export class NativeScriptNgZone implements NgZone {
200
201
* If a synchronous error happens it will be rethrown and not reported via `onError`.
201
202
*/
202
203
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 ;
204
205
const task = zone . scheduleEventTask ( 'NgZoneEvent: ' + name , fn , EMPTY_PAYLOAD , noop , noop ) ;
205
206
try {
206
207
return zone . runTask ( task , applyThis , applyArgs ) ;
@@ -214,7 +215,7 @@ export class NativeScriptNgZone implements NgZone {
214
215
* rethrown.
215
216
*/
216
217
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 ) ;
218
219
}
219
220
220
221
/**
@@ -231,7 +232,7 @@ export class NativeScriptNgZone implements NgZone {
231
232
* Use {@link #run} to reenter the Angular zone and do work that updates the application model.
232
233
*/
233
234
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 ) ;
235
236
}
236
237
}
237
238
0 commit comments