11
11
( factory ( ) ) ;
12
12
} ( this , ( function ( ) { 'use strict' ;
13
13
14
+ var profile = require ( "tns-core-modules/profiling" ) . profile ;
15
+
14
16
/**
15
17
* @license
16
18
* Copyright Google Inc. All Rights Reserved.
@@ -116,7 +118,7 @@ var Zone$1 = (function (global) {
116
118
return zone . runGuarded ( _callback , this , arguments , source ) ;
117
119
} ;
118
120
} ;
119
- Zone . prototype . run = function ( callback , applyThis , applyArgs , source ) {
121
+ Zone . prototype . run = profile ( '"zone-nativescript".Zone.run' , function ( callback , applyThis , applyArgs , source ) {
120
122
if ( applyThis === void 0 ) { applyThis = undefined ; }
121
123
if ( applyArgs === void 0 ) { applyArgs = null ; }
122
124
if ( source === void 0 ) { source = null ; }
@@ -127,7 +129,7 @@ var Zone$1 = (function (global) {
127
129
finally {
128
130
_currentZoneFrame = _currentZoneFrame . parent ;
129
131
}
130
- } ;
132
+ } ) ;
131
133
Zone . prototype . runGuarded = function ( callback , applyThis , applyArgs , source ) {
132
134
if ( applyThis === void 0 ) { applyThis = null ; }
133
135
if ( applyArgs === void 0 ) { applyArgs = null ; }
@@ -581,7 +583,7 @@ var Zone$1 = (function (global) {
581
583
catch ( err ) {
582
584
}
583
585
}
584
- function drainMicroTaskQueue ( ) {
586
+ const drainMicroTaskQueue = profile ( '"zone-nativescript".drainMicrotaskQueue' , function drainMicroTaskQueue ( ) {
585
587
if ( ! _isDrainingMicrotaskQueue ) {
586
588
_isDrainingMicrotaskQueue = true ;
587
589
while ( _microTaskQueue . length ) {
@@ -615,7 +617,8 @@ var Zone$1 = (function (global) {
615
617
}
616
618
_isDrainingMicrotaskQueue = false ;
617
619
}
618
- }
620
+ } ) ;
621
+ Zone . drainMicroTaskQueue = drainMicroTaskQueue ;
619
622
function isThenable ( value ) {
620
623
return value && value . then ;
621
624
}
@@ -1648,7 +1651,7 @@ function patchTimer(window, setName, cancelName, nameSuffix) {
1648
1651
return clearNative ( task . data . handleId ) ;
1649
1652
}
1650
1653
setNative =
1651
- patchMethod ( window , setName , function ( delegate ) { return function ( self , args ) {
1654
+ patchMethod ( window , setName , profile ( '"zone-nativescript" set ' + setName + ' patched' , function ( delegate ) { return function ( self , args ) {
1652
1655
if ( typeof args [ 0 ] === 'function' ) {
1653
1656
var zone = Zone . current ;
1654
1657
var options = {
@@ -1676,9 +1679,9 @@ function patchTimer(window, setName, cancelName, nameSuffix) {
1676
1679
// cause an error by calling it directly.
1677
1680
return delegate . apply ( window , args ) ;
1678
1681
}
1679
- } ; } ) ;
1682
+ } ; } ) ) ;
1680
1683
clearNative =
1681
- patchMethod ( window , cancelName , function ( delegate ) { return function ( self , args ) {
1684
+ patchMethod ( window , cancelName , profile ( '"zone-nativescript" clear ' + setName + ' patched' , function ( delegate ) { return function ( self , args ) {
1682
1685
var task = typeof args [ 0 ] === 'number' ? tasksByHandleId [ args [ 0 ] ] : args [ 0 ] ;
1683
1686
if ( task && typeof task . type === 'string' ) {
1684
1687
if ( task . state !== 'notScheduled' &&
@@ -1691,7 +1694,7 @@ function patchTimer(window, setName, cancelName, nameSuffix) {
1691
1694
// cause an error by calling it directly.
1692
1695
delegate . apply ( window , args ) ;
1693
1696
}
1694
- } ; } ) ;
1697
+ } ; } ) ) ;
1695
1698
}
1696
1699
1697
1700
/**
0 commit comments