1
+ /******/ ( function ( modules ) { // webpackBootstrap
2
+ /******/ // The module cache
3
+ /******/ var installedModules = { } ;
4
+
5
+ /******/ // The require function
6
+ /******/ function __webpack_require__ ( moduleId ) {
7
+
8
+ /******/ // Check if module is in cache
9
+ /******/ if ( installedModules [ moduleId ] )
10
+ /******/ return installedModules [ moduleId ] . exports ;
11
+
12
+ /******/ // Create a new module (and put it into the cache)
13
+ /******/ var module = installedModules [ moduleId ] = {
14
+ /******/ exports : { } ,
15
+ /******/ id : moduleId ,
16
+ /******/ loaded : false
17
+ /******/ } ;
18
+
19
+ /******/ // Execute the module function
20
+ /******/ modules [ moduleId ] . call ( module . exports , module , module . exports , __webpack_require__ ) ;
21
+
22
+ /******/ // Flag the module as loaded
23
+ /******/ module . loaded = true ;
24
+
25
+ /******/ // Return the exports of the module
26
+ /******/ return module . exports ;
27
+ /******/ }
28
+
29
+
30
+ /******/ // expose the modules object (__webpack_modules__)
31
+ /******/ __webpack_require__ . m = modules ;
32
+
33
+ /******/ // expose the module cache
34
+ /******/ __webpack_require__ . c = installedModules ;
35
+
36
+ /******/ // __webpack_public_path__
37
+ /******/ __webpack_require__ . p = "" ;
38
+
39
+ /******/ // Load entry module and return exports
40
+ /******/ return __webpack_require__ ( 0 ) ;
41
+ /******/ } )
42
+ /************************************************************************/
43
+ /******/ ( [
44
+ /* 0 */
45
+ /***/ function ( module , exports ) {
46
+
47
+ ( function ( ) {
48
+ var AsyncTestZoneSpec = ( function ( ) {
49
+ function AsyncTestZoneSpec ( finishCallback , failCallback , namePrefix ) {
50
+ this . _pendingMicroTasks = false ;
51
+ this . _pendingMacroTasks = false ;
52
+ this . _pendingEventTasks = false ;
53
+ // ZoneSpec implementation below.
54
+ this . name = 'asyncTestZone' ;
55
+ this . _finishCallback = finishCallback ;
56
+ this . _failCallback = failCallback ;
57
+ this . name = 'asyncTestZone for ' + namePrefix ;
58
+ }
59
+ AsyncTestZoneSpec . prototype . _finishCallbackIfDone = function ( ) {
60
+ if ( ! ( this . _pendingMicroTasks || this . _pendingMacroTasks || this . _pendingEventTasks ) ) {
61
+ this . _finishCallback ( ) ;
62
+ }
63
+ } ;
64
+ AsyncTestZoneSpec . prototype . onInvoke = function ( parentZoneDelegate , currentZone , targetZone , delegate , applyThis , applyArgs , source ) {
65
+ try {
66
+ return parentZoneDelegate . invoke ( targetZone , delegate , applyThis , applyArgs , source ) ;
67
+ }
68
+ finally {
69
+ this . _finishCallbackIfDone ( ) ;
70
+ }
71
+ } ;
72
+ AsyncTestZoneSpec . prototype . onInvokeTask = function ( delegate , current , target , task , applyThis , applyArgs ) {
73
+ try {
74
+ return delegate . invokeTask ( target , task , applyThis , applyArgs ) ;
75
+ }
76
+ finally {
77
+ this . _finishCallbackIfDone ( ) ;
78
+ }
79
+ } ;
80
+ ;
81
+ AsyncTestZoneSpec . prototype . onHandleError = function ( parentZoneDelegate , currentZone , targetZone , error ) {
82
+ // Let the parent try to handle it.
83
+ var result = parentZoneDelegate . handleError ( targetZone , error ) ;
84
+ if ( result ) {
85
+ console . log ( error . message ) ;
86
+ console . log ( error . stack ) ;
87
+ this . _failCallback ( error . message ? error . message : 'unknown error' ) ;
88
+ }
89
+ return false ;
90
+ } ;
91
+ AsyncTestZoneSpec . prototype . onScheduleTask = function ( delegate , currentZone , targetZone , task ) {
92
+ if ( task . type == 'macroTask' && task . source == 'setInterval' ) {
93
+ this . _failCallback ( 'Cannot use setInterval from within an async zone test.' ) ;
94
+ // TODO(juliemr): any other cleanup we want to handle here?
95
+ return ;
96
+ }
97
+ return delegate . scheduleTask ( targetZone , task ) ;
98
+ } ;
99
+ AsyncTestZoneSpec . prototype . onHasTask = function ( delegate , current , target , hasTaskState ) {
100
+ delegate . hasTask ( target , hasTaskState ) ;
101
+ if ( hasTaskState . change == 'microTask' ) {
102
+ this . _pendingMicroTasks = hasTaskState . microTask ;
103
+ this . _finishCallbackIfDone ( ) ;
104
+ }
105
+ else if ( hasTaskState . change == 'macroTask' ) {
106
+ this . _pendingMicroTasks = hasTaskState . macroTask ;
107
+ this . _finishCallbackIfDone ( ) ;
108
+ }
109
+ else if ( hasTaskState . change == 'eventTask' ) {
110
+ this . _finishCallbackIfDone ( ) ;
111
+ }
112
+ } ;
113
+ return AsyncTestZoneSpec ;
114
+ } ( ) ) ;
115
+ // Export the class so that new instances can be created with proper
116
+ // constructor params.
117
+ Zone [ 'AsyncTestZoneSpec' ] = AsyncTestZoneSpec ;
118
+ } ) ( ) ;
119
+
120
+
121
+ /***/ }
122
+ /******/ ] ) ;
0 commit comments