OLD | NEW |
1 dart_library.library('dart/async', null, /* Imports */[ | 1 dart_library.library('dart/async', null, /* Imports */[ |
2 'dart/_runtime', | 2 'dart/_runtime', |
3 'dart/core', | 3 'dart/core', |
4 'dart/_internal', | 4 'dart/_internal', |
5 'dart/collection' | 5 'dart/collection' |
6 ], /* Lazy imports */[ | 6 ], /* Lazy imports */[ |
7 'dart/_isolate_helper' | 7 'dart/_isolate_helper' |
8 ], function(exports, dart, core, _internal, collection, _isolate_helper) { | 8 ], function(exports, dart, core, _internal, collection, _isolate_helper) { |
9 'use strict'; | 9 'use strict'; |
10 let dartx = dart.dartx; | 10 let dartx = dart.dartx; |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 try { | 315 try { |
316 buffer.write(element); | 316 buffer.write(element); |
317 } catch (e) { | 317 } catch (e) { |
318 let s = dart.stackTrace(e); | 318 let s = dart.stackTrace(e); |
319 _cancelAndErrorWithReplacement(subscription, result, e, s); | 319 _cancelAndErrorWithReplacement(subscription, result, e, s); |
320 } | 320 } |
321 | 321 |
322 }, dart.void, [T]), {onError: dart.fn(e => { | 322 }, dart.void, [T]), {onError: dart.fn(e => { |
323 result[_completeError](e); | 323 result[_completeError](e); |
324 }), onDone: dart.fn(() => { | 324 }), onDone: dart.fn(() => { |
325 result[_complete](dart.toString(buffer)); | 325 result[_complete](buffer.toString()); |
326 }, dart.void, []), cancelOnError: true}); | 326 }, dart.void, []), cancelOnError: true}); |
327 return result; | 327 return result; |
328 } | 328 } |
329 contains(needle) { | 329 contains(needle) { |
330 let future = new (_Future$(core.bool))(); | 330 let future = new (_Future$(core.bool))(); |
331 let subscription = null; | 331 let subscription = null; |
332 subscription = this.listen(dart.fn(element => { | 332 subscription = this.listen(dart.fn(element => { |
333 dart.as(element, T); | 333 dart.as(element, T); |
334 _runUserCode(dart.fn(() => dart.equals(element, needle), core.bool, []
), dart.fn(isMatch => { | 334 _runUserCode(dart.fn(() => dart.equals(element, needle), core.bool, []
), dart.fn(isMatch => { |
335 if (dart.notNull(isMatch)) { | 335 if (dart.notNull(isMatch)) { |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 } | 798 } |
799 [_createSubscription](onData, onError, onDone, cancelOnError) { | 799 [_createSubscription](onData, onError, onDone, cancelOnError) { |
800 dart.as(onData, dart.functionType(dart.void, [T])); | 800 dart.as(onData, dart.functionType(dart.void, [T])); |
801 dart.as(onDone, dart.functionType(dart.void, [])); | 801 dart.as(onDone, dart.functionType(dart.void, [])); |
802 return this[_controller][_subscribe](onData, onError, onDone, cancelOnEr
ror); | 802 return this[_controller][_subscribe](onData, onError, onDone, cancelOnEr
ror); |
803 } | 803 } |
804 get hashCode() { | 804 get hashCode() { |
805 return dart.notNull(dart.hashCode(this[_controller])) ^ 892482866; | 805 return dart.notNull(dart.hashCode(this[_controller])) ^ 892482866; |
806 } | 806 } |
807 ['=='](other) { | 807 ['=='](other) { |
808 if (dart.notNull(core.identical(this, other))) return true; | 808 if (core.identical(this, other)) return true; |
809 if (!dart.is(other, _ControllerStream$())) return false; | 809 if (!dart.is(other, _ControllerStream$())) return false; |
810 let otherStream = dart.as(other, _ControllerStream$()); | 810 let otherStream = dart.as(other, _ControllerStream$()); |
811 return core.identical(otherStream[_controller], this[_controller]); | 811 return core.identical(otherStream[_controller], this[_controller]); |
812 } | 812 } |
813 } | 813 } |
814 dart.setSignature(_ControllerStream, { | 814 dart.setSignature(_ControllerStream, { |
815 constructors: () => ({_ControllerStream: [_ControllerStream$(T), [_StreamC
ontrollerLifecycle$(T)]]}), | 815 constructors: () => ({_ControllerStream: [_ControllerStream$(T), [_StreamC
ontrollerLifecycle$(T)]]}), |
816 methods: () => ({ | 816 methods: () => ({ |
817 [_createSubscription]: [StreamSubscription$(T), [dart.functionType(dart.
void, [T]), core.Function, dart.functionType(dart.void, []), core.bool]], | 817 [_createSubscription]: [StreamSubscription$(T), [dart.functionType(dart.
void, [T]), core.Function, dart.functionType(dart.void, []), core.bool]], |
818 '==': [core.bool, [core.Object]] | 818 '==': [core.bool, [core.Object]] |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 dart.assert(core.identical(subscription[_next], subscription)); | 1337 dart.assert(core.identical(subscription[_next], subscription)); |
1338 subscription[_previous] = this[_previous]; | 1338 subscription[_previous] = this[_previous]; |
1339 subscription[_next] = this; | 1339 subscription[_next] = this; |
1340 this[_previous][_next] = subscription; | 1340 this[_previous][_next] = subscription; |
1341 this[_previous] = subscription; | 1341 this[_previous] = subscription; |
1342 subscription[_eventState] = dart.notNull(this[_state]) & dart.notNull(_B
roadcastStreamController$()._STATE_EVENT_ID); | 1342 subscription[_eventState] = dart.notNull(this[_state]) & dart.notNull(_B
roadcastStreamController$()._STATE_EVENT_ID); |
1343 } | 1343 } |
1344 [_removeListener](subscription) { | 1344 [_removeListener](subscription) { |
1345 dart.as(subscription, _BroadcastSubscription$(T)); | 1345 dart.as(subscription, _BroadcastSubscription$(T)); |
1346 dart.assert(core.identical(subscription[_controller], this)); | 1346 dart.assert(core.identical(subscription[_controller], this)); |
1347 dart.assert(!dart.notNull(core.identical(subscription[_next], subscripti
on))); | 1347 dart.assert(!core.identical(subscription[_next], subscription)); |
1348 let previous = subscription[_previous]; | 1348 let previous = subscription[_previous]; |
1349 let next = subscription[_next]; | 1349 let next = subscription[_next]; |
1350 previous[_next] = next; | 1350 previous[_next] = next; |
1351 next[_previous] = previous; | 1351 next[_previous] = previous; |
1352 subscription[_next] = subscription[_previous] = subscription; | 1352 subscription[_next] = subscription[_previous] = subscription; |
1353 } | 1353 } |
1354 [_subscribe](onData, onError, onDone, cancelOnError) { | 1354 [_subscribe](onData, onError, onDone, cancelOnError) { |
1355 dart.as(onData, dart.functionType(dart.void, [T])); | 1355 dart.as(onData, dart.functionType(dart.void, [T])); |
1356 dart.as(onDone, dart.functionType(dart.void, [])); | 1356 dart.as(onDone, dart.functionType(dart.void, [])); |
1357 if (dart.notNull(this.isClosed)) { | 1357 if (dart.notNull(this.isClosed)) { |
1358 if (onDone == null) onDone = _nullDoneHandler; | 1358 if (onDone == null) onDone = _nullDoneHandler; |
1359 return new (_DoneStreamSubscription$(T))(onDone); | 1359 return new (_DoneStreamSubscription$(T))(onDone); |
1360 } | 1360 } |
1361 let subscription = new (_BroadcastSubscription$(T))(this, onData, onErro
r, onDone, cancelOnError); | 1361 let subscription = new (_BroadcastSubscription$(T))(this, onData, onErro
r, onDone, cancelOnError); |
1362 this[_addListener](dart.as(subscription, _BroadcastSubscription$(T))); | 1362 this[_addListener](dart.as(subscription, _BroadcastSubscription$(T))); |
1363 if (dart.notNull(core.identical(this[_next], this[_previous]))) { | 1363 if (core.identical(this[_next], this[_previous])) { |
1364 _runGuarded(this[_onListen]); | 1364 _runGuarded(this[_onListen]); |
1365 } | 1365 } |
1366 return dart.as(subscription, StreamSubscription$(T)); | 1366 return dart.as(subscription, StreamSubscription$(T)); |
1367 } | 1367 } |
1368 [_recordCancel](sub) { | 1368 [_recordCancel](sub) { |
1369 dart.as(sub, StreamSubscription$(T)); | 1369 dart.as(sub, StreamSubscription$(T)); |
1370 let subscription = dart.as(sub, _BroadcastSubscription$(T)); | 1370 let subscription = dart.as(sub, _BroadcastSubscription$(T)); |
1371 if (dart.notNull(core.identical(subscription[_next], subscription))) ret
urn null; | 1371 if (core.identical(subscription[_next], subscription)) return null; |
1372 dart.assert(!dart.notNull(core.identical(subscription[_next], subscripti
on))); | 1372 dart.assert(!core.identical(subscription[_next], subscription)); |
1373 if (dart.notNull(subscription[_isFiring])) { | 1373 if (dart.notNull(subscription[_isFiring])) { |
1374 subscription[_setRemoveAfterFiring](); | 1374 subscription[_setRemoveAfterFiring](); |
1375 } else { | 1375 } else { |
1376 dart.assert(!dart.notNull(core.identical(subscription[_next], subscrip
tion))); | 1376 dart.assert(!core.identical(subscription[_next], subscription)); |
1377 this[_removeListener](subscription); | 1377 this[_removeListener](subscription); |
1378 if (!dart.notNull(this[_isFiring]) && dart.notNull(this[_isEmpty])) { | 1378 if (!dart.notNull(this[_isFiring]) && dart.notNull(this[_isEmpty])) { |
1379 this[_callOnCancel](); | 1379 this[_callOnCancel](); |
1380 } | 1380 } |
1381 } | 1381 } |
1382 return null; | 1382 return null; |
1383 } | 1383 } |
1384 [_recordPause](subscription) { | 1384 [_recordPause](subscription) { |
1385 dart.as(subscription, StreamSubscription$(T)); | 1385 dart.as(subscription, StreamSubscription$(T)); |
1386 } | 1386 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 } | 1448 } |
1449 [_forEachListener](action) { | 1449 [_forEachListener](action) { |
1450 dart.as(action, dart.functionType(dart.void, [_BufferingStreamSubscripti
on$(T)])); | 1450 dart.as(action, dart.functionType(dart.void, [_BufferingStreamSubscripti
on$(T)])); |
1451 if (dart.notNull(this[_isFiring])) { | 1451 if (dart.notNull(this[_isFiring])) { |
1452 dart.throw(new core.StateError("Cannot fire new event. Controller is a
lready firing an event")); | 1452 dart.throw(new core.StateError("Cannot fire new event. Controller is a
lready firing an event")); |
1453 } | 1453 } |
1454 if (dart.notNull(this[_isEmpty])) return; | 1454 if (dart.notNull(this[_isEmpty])) return; |
1455 let id = dart.notNull(this[_state]) & dart.notNull(_BroadcastStreamContr
oller$()._STATE_EVENT_ID); | 1455 let id = dart.notNull(this[_state]) & dart.notNull(_BroadcastStreamContr
oller$()._STATE_EVENT_ID); |
1456 this[_state] = dart.notNull(this[_state]) ^ (dart.notNull(_BroadcastStre
amController$()._STATE_EVENT_ID) | dart.notNull(_BroadcastStreamController$()._S
TATE_FIRING)); | 1456 this[_state] = dart.notNull(this[_state]) ^ (dart.notNull(_BroadcastStre
amController$()._STATE_EVENT_ID) | dart.notNull(_BroadcastStreamController$()._S
TATE_FIRING)); |
1457 let link = this[_next]; | 1457 let link = this[_next]; |
1458 while (!dart.notNull(core.identical(link, this))) { | 1458 while (!core.identical(link, this)) { |
1459 let subscription = dart.as(link, _BroadcastSubscription$(T)); | 1459 let subscription = dart.as(link, _BroadcastSubscription$(T)); |
1460 if (dart.notNull(subscription[_expectsEvent](id))) { | 1460 if (dart.notNull(subscription[_expectsEvent](id))) { |
1461 subscription[_eventState] = dart.notNull(subscription[_eventState])
| dart.notNull(_BroadcastSubscription._STATE_FIRING); | 1461 subscription[_eventState] = dart.notNull(subscription[_eventState])
| dart.notNull(_BroadcastSubscription._STATE_FIRING); |
1462 action(subscription); | 1462 action(subscription); |
1463 subscription[_toggleEventId](); | 1463 subscription[_toggleEventId](); |
1464 link = subscription[_next]; | 1464 link = subscription[_next]; |
1465 if (dart.notNull(subscription[_removeAfterFiring])) { | 1465 if (dart.notNull(subscription[_removeAfterFiring])) { |
1466 this[_removeListener](subscription); | 1466 this[_removeListener](subscription); |
1467 } | 1467 } |
1468 subscription[_eventState] = dart.notNull(subscription[_eventState])
& ~dart.notNull(_BroadcastSubscription._STATE_FIRING); | 1468 subscription[_eventState] = dart.notNull(subscription[_eventState])
& ~dart.notNull(_BroadcastSubscription._STATE_FIRING); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1568 return _SyncBroadcastStreamController; | 1568 return _SyncBroadcastStreamController; |
1569 }); | 1569 }); |
1570 let _SyncBroadcastStreamController = _SyncBroadcastStreamController$(); | 1570 let _SyncBroadcastStreamController = _SyncBroadcastStreamController$(); |
1571 const _AsyncBroadcastStreamController$ = dart.generic(function(T) { | 1571 const _AsyncBroadcastStreamController$ = dart.generic(function(T) { |
1572 class _AsyncBroadcastStreamController extends _BroadcastStreamController$(T)
{ | 1572 class _AsyncBroadcastStreamController extends _BroadcastStreamController$(T)
{ |
1573 _AsyncBroadcastStreamController(onListen, onCancel) { | 1573 _AsyncBroadcastStreamController(onListen, onCancel) { |
1574 super._BroadcastStreamController(onListen, onCancel); | 1574 super._BroadcastStreamController(onListen, onCancel); |
1575 } | 1575 } |
1576 [_sendData](data) { | 1576 [_sendData](data) { |
1577 dart.as(data, T); | 1577 dart.as(data, T); |
1578 for (let link = this[_next]; !dart.notNull(core.identical(link, this));
link = link[_next]) { | 1578 for (let link = this[_next]; !core.identical(link, this); link = link[_n
ext]) { |
1579 let subscription = dart.as(link, _BroadcastSubscription$(T)); | 1579 let subscription = dart.as(link, _BroadcastSubscription$(T)); |
1580 subscription[_addPending](new _DelayedData(data)); | 1580 subscription[_addPending](new _DelayedData(data)); |
1581 } | 1581 } |
1582 } | 1582 } |
1583 [_sendError](error, stackTrace) { | 1583 [_sendError](error, stackTrace) { |
1584 for (let link = this[_next]; !dart.notNull(core.identical(link, this));
link = link[_next]) { | 1584 for (let link = this[_next]; !core.identical(link, this); link = link[_n
ext]) { |
1585 let subscription = dart.as(link, _BroadcastSubscription$(T)); | 1585 let subscription = dart.as(link, _BroadcastSubscription$(T)); |
1586 subscription[_addPending](new _DelayedError(error, stackTrace)); | 1586 subscription[_addPending](new _DelayedError(error, stackTrace)); |
1587 } | 1587 } |
1588 } | 1588 } |
1589 [_sendDone]() { | 1589 [_sendDone]() { |
1590 if (!dart.notNull(this[_isEmpty])) { | 1590 if (!dart.notNull(this[_isEmpty])) { |
1591 for (let link = this[_next]; !dart.notNull(core.identical(link, this))
; link = link[_next]) { | 1591 for (let link = this[_next]; !core.identical(link, this); link = link[
_next]) { |
1592 let subscription = dart.as(link, _BroadcastSubscription$(T)); | 1592 let subscription = dart.as(link, _BroadcastSubscription$(T)); |
1593 subscription[_addPending](dart.const(new _DelayedDone())); | 1593 subscription[_addPending](dart.const(new _DelayedDone())); |
1594 } | 1594 } |
1595 } else { | 1595 } else { |
1596 dart.assert(this[_doneFuture] != null); | 1596 dart.assert(this[_doneFuture] != null); |
1597 dart.assert(this[_doneFuture][_mayComplete]); | 1597 dart.assert(this[_doneFuture][_mayComplete]); |
1598 this[_doneFuture][_asyncComplete](null); | 1598 this[_doneFuture][_asyncComplete](null); |
1599 } | 1599 } |
1600 } | 1600 } |
1601 } | 1601 } |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1799 } | 1799 } |
1800 | 1800 |
1801 } | 1801 } |
1802 static value(value) { | 1802 static value(value) { |
1803 if (value === void 0) value = null; | 1803 if (value === void 0) value = null; |
1804 return new (_Future$(T)).immediate(value); | 1804 return new (_Future$(T)).immediate(value); |
1805 } | 1805 } |
1806 static error(error, stackTrace) { | 1806 static error(error, stackTrace) { |
1807 if (stackTrace === void 0) stackTrace = null; | 1807 if (stackTrace === void 0) stackTrace = null; |
1808 error = _nonNullError(error); | 1808 error = _nonNullError(error); |
1809 if (!dart.notNull(core.identical(Zone.current, _ROOT_ZONE))) { | 1809 if (!core.identical(Zone.current, _ROOT_ZONE)) { |
1810 let replacement = Zone.current.errorCallback(error, stackTrace); | 1810 let replacement = Zone.current.errorCallback(error, stackTrace); |
1811 if (replacement != null) { | 1811 if (replacement != null) { |
1812 error = _nonNullError(replacement.error); | 1812 error = _nonNullError(replacement.error); |
1813 stackTrace = replacement.stackTrace; | 1813 stackTrace = replacement.stackTrace; |
1814 } | 1814 } |
1815 } | 1815 } |
1816 return new (_Future$(T)).immediateError(error, stackTrace); | 1816 return new (_Future$(T)).immediateError(error, stackTrace); |
1817 } | 1817 } |
1818 static delayed(duration, computation) { | 1818 static delayed(duration, computation) { |
1819 if (computation === void 0) computation = null; | 1819 if (computation === void 0) computation = null; |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2214 this[_state] = _Future$()._CHAINED; | 2214 this[_state] = _Future$()._CHAINED; |
2215 } else { | 2215 } else { |
2216 dart.assert(this[_isChained]); | 2216 dart.assert(this[_isChained]); |
2217 this[_state] = _Future$()._INCOMPLETE; | 2217 this[_state] = _Future$()._INCOMPLETE; |
2218 } | 2218 } |
2219 } | 2219 } |
2220 then(f, opts) { | 2220 then(f, opts) { |
2221 dart.as(f, dart.functionType(dart.dynamic, [T])); | 2221 dart.as(f, dart.functionType(dart.dynamic, [T])); |
2222 let onError = opts && 'onError' in opts ? opts.onError : null; | 2222 let onError = opts && 'onError' in opts ? opts.onError : null; |
2223 let result = new (_Future$())(); | 2223 let result = new (_Future$())(); |
2224 if (!dart.notNull(core.identical(result[_zone], _ROOT_ZONE))) { | 2224 if (!core.identical(result[_zone], _ROOT_ZONE)) { |
2225 f = dart.as(result[_zone].registerUnaryCallback(f), __CastType4); | 2225 f = dart.as(result[_zone].registerUnaryCallback(f), __CastType4); |
2226 if (onError != null) { | 2226 if (onError != null) { |
2227 onError = _registerErrorHandler(onError, result[_zone]); | 2227 onError = _registerErrorHandler(onError, result[_zone]); |
2228 } | 2228 } |
2229 } | 2229 } |
2230 this[_addListener](new _FutureListener.then(result, f, onError)); | 2230 this[_addListener](new _FutureListener.then(result, f, onError)); |
2231 return result; | 2231 return result; |
2232 } | 2232 } |
2233 catchError(onError, opts) { | 2233 catchError(onError, opts) { |
2234 let test = opts && 'test' in opts ? opts.test : null; | 2234 let test = opts && 'test' in opts ? opts.test : null; |
2235 dart.as(test, dart.functionType(core.bool, [dart.dynamic])); | 2235 dart.as(test, dart.functionType(core.bool, [dart.dynamic])); |
2236 let result = new (_Future$())(); | 2236 let result = new (_Future$())(); |
2237 if (!dart.notNull(core.identical(result[_zone], _ROOT_ZONE))) { | 2237 if (!core.identical(result[_zone], _ROOT_ZONE)) { |
2238 onError = _registerErrorHandler(onError, result[_zone]); | 2238 onError = _registerErrorHandler(onError, result[_zone]); |
2239 if (test != null) test = dart.as(result[_zone].registerUnaryCallback(t
est), __CastType6); | 2239 if (test != null) test = dart.as(result[_zone].registerUnaryCallback(t
est), __CastType6); |
2240 } | 2240 } |
2241 this[_addListener](new _FutureListener.catchError(result, onError, test)
); | 2241 this[_addListener](new _FutureListener.catchError(result, onError, test)
); |
2242 return result; | 2242 return result; |
2243 } | 2243 } |
2244 whenComplete(action) { | 2244 whenComplete(action) { |
2245 dart.as(action, dart.functionType(dart.dynamic, [])); | 2245 dart.as(action, dart.functionType(dart.dynamic, [])); |
2246 let result = new (_Future$(T))(); | 2246 let result = new (_Future$(T))(); |
2247 if (!dart.notNull(core.identical(result[_zone], _ROOT_ZONE))) { | 2247 if (!core.identical(result[_zone], _ROOT_ZONE)) { |
2248 action = result[_zone].registerCallback(action); | 2248 action = result[_zone].registerCallback(action); |
2249 } | 2249 } |
2250 this[_addListener](new _FutureListener.whenComplete(result, action)); | 2250 this[_addListener](new _FutureListener.whenComplete(result, action)); |
2251 return dart.as(result, Future$(T)); | 2251 return dart.as(result, Future$(T)); |
2252 } | 2252 } |
2253 asStream() { | 2253 asStream() { |
2254 return Stream$(T).fromFuture(this); | 2254 return Stream$(T).fromFuture(this); |
2255 } | 2255 } |
2256 [_markPendingCompletion]() { | 2256 [_markPendingCompletion]() { |
2257 if (!dart.notNull(this[_mayComplete])) dart.throw(new core.StateError("F
uture already completed")); | 2257 if (!dart.notNull(this[_mayComplete])) dart.throw(new core.StateError("F
uture already completed")); |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2412 let listenerValueOrError = sourceValue; | 2412 let listenerValueOrError = sourceValue; |
2413 let isPropagationAborted = false; | 2413 let isPropagationAborted = false; |
2414 if (dart.notNull(hasError) || dart.notNull(listener.handlesValue) || d
art.notNull(listener.handlesComplete)) { | 2414 if (dart.notNull(hasError) || dart.notNull(listener.handlesValue) || d
art.notNull(listener.handlesComplete)) { |
2415 let zone = listener[_zone]; | 2415 let zone = listener[_zone]; |
2416 if (dart.notNull(hasError) && !dart.notNull(source[_zone].inSameErro
rZone(zone))) { | 2416 if (dart.notNull(hasError) && !dart.notNull(source[_zone].inSameErro
rZone(zone))) { |
2417 let asyncError = source[_error]; | 2417 let asyncError = source[_error]; |
2418 source[_zone].handleUncaughtError(asyncError.error, asyncError.sta
ckTrace); | 2418 source[_zone].handleUncaughtError(asyncError.error, asyncError.sta
ckTrace); |
2419 return; | 2419 return; |
2420 } | 2420 } |
2421 let oldZone = null; | 2421 let oldZone = null; |
2422 if (!dart.notNull(core.identical(Zone.current, zone))) { | 2422 if (!core.identical(Zone.current, zone)) { |
2423 oldZone = Zone._enter(zone); | 2423 oldZone = Zone._enter(zone); |
2424 } | 2424 } |
2425 function handleValueCallback() { | 2425 function handleValueCallback() { |
2426 try { | 2426 try { |
2427 listenerValueOrError = zone.runUnary(listener[_onValue], sourceV
alue); | 2427 listenerValueOrError = zone.runUnary(listener[_onValue], sourceV
alue); |
2428 return true; | 2428 return true; |
2429 } catch (e) { | 2429 } catch (e) { |
2430 let s = dart.stackTrace(e); | 2430 let s = dart.stackTrace(e); |
2431 listenerValueOrError = new AsyncError(e, s); | 2431 listenerValueOrError = new AsyncError(e, s); |
2432 return false; | 2432 return false; |
2433 } | 2433 } |
2434 | 2434 |
2435 } | 2435 } |
2436 dart.fn(handleValueCallback, core.bool, []); | 2436 dart.fn(handleValueCallback, core.bool, []); |
2437 function handleError() { | 2437 function handleError() { |
2438 let asyncError = source[_error]; | 2438 let asyncError = source[_error]; |
2439 let matchesTest = true; | 2439 let matchesTest = true; |
2440 if (dart.notNull(listener.hasErrorTest)) { | 2440 if (dart.notNull(listener.hasErrorTest)) { |
2441 let test = listener[_errorTest]; | 2441 let test = listener[_errorTest]; |
2442 try { | 2442 try { |
2443 matchesTest = dart.as(zone.runUnary(test, asyncError.error), c
ore.bool); | 2443 matchesTest = dart.as(zone.runUnary(test, asyncError.error), c
ore.bool); |
2444 } catch (e) { | 2444 } catch (e) { |
2445 let s = dart.stackTrace(e); | 2445 let s = dart.stackTrace(e); |
2446 listenerValueOrError = dart.notNull(core.identical(asyncError.
error, e)) ? asyncError : new AsyncError(e, s); | 2446 listenerValueOrError = core.identical(asyncError.error, e) ? a
syncError : new AsyncError(e, s); |
2447 listenerHasValue = false; | 2447 listenerHasValue = false; |
2448 return; | 2448 return; |
2449 } | 2449 } |
2450 | 2450 |
2451 } | 2451 } |
2452 let errorCallback = listener[_onError]; | 2452 let errorCallback = listener[_onError]; |
2453 if (dart.notNull(matchesTest) && errorCallback != null) { | 2453 if (dart.notNull(matchesTest) && errorCallback != null) { |
2454 try { | 2454 try { |
2455 if (dart.is(errorCallback, ZoneBinaryCallback)) { | 2455 if (dart.is(errorCallback, ZoneBinaryCallback)) { |
2456 listenerValueOrError = zone.runBinary(errorCallback, asyncEr
ror.error, asyncError.stackTrace); | 2456 listenerValueOrError = zone.runBinary(errorCallback, asyncEr
ror.error, asyncError.stackTrace); |
2457 } else { | 2457 } else { |
2458 listenerValueOrError = zone.runUnary(dart.as(errorCallback,
__CastType8), asyncError.error); | 2458 listenerValueOrError = zone.runUnary(dart.as(errorCallback,
__CastType8), asyncError.error); |
2459 } | 2459 } |
2460 } catch (e) { | 2460 } catch (e) { |
2461 let s = dart.stackTrace(e); | 2461 let s = dart.stackTrace(e); |
2462 listenerValueOrError = dart.notNull(core.identical(asyncError.
error, e)) ? asyncError : new AsyncError(e, s); | 2462 listenerValueOrError = core.identical(asyncError.error, e) ? a
syncError : new AsyncError(e, s); |
2463 listenerHasValue = false; | 2463 listenerHasValue = false; |
2464 return; | 2464 return; |
2465 } | 2465 } |
2466 | 2466 |
2467 listenerHasValue = true; | 2467 listenerHasValue = true; |
2468 } else { | 2468 } else { |
2469 listenerValueOrError = asyncError; | 2469 listenerValueOrError = asyncError; |
2470 listenerHasValue = false; | 2470 listenerHasValue = false; |
2471 } | 2471 } |
2472 } | 2472 } |
2473 dart.fn(handleError, dart.void, []); | 2473 dart.fn(handleError, dart.void, []); |
2474 function handleWhenCompleteCallback() { | 2474 function handleWhenCompleteCallback() { |
2475 let completeResult = null; | 2475 let completeResult = null; |
2476 try { | 2476 try { |
2477 completeResult = zone.run(listener[_whenCompleteAction]); | 2477 completeResult = zone.run(listener[_whenCompleteAction]); |
2478 } catch (e) { | 2478 } catch (e) { |
2479 let s = dart.stackTrace(e); | 2479 let s = dart.stackTrace(e); |
2480 if (dart.notNull(hasError) && dart.notNull(core.identical(source
[_error].error, e))) { | 2480 if (dart.notNull(hasError) && core.identical(source[_error].erro
r, e)) { |
2481 listenerValueOrError = source[_error]; | 2481 listenerValueOrError = source[_error]; |
2482 } else { | 2482 } else { |
2483 listenerValueOrError = new AsyncError(e, s); | 2483 listenerValueOrError = new AsyncError(e, s); |
2484 } | 2484 } |
2485 listenerHasValue = false; | 2485 listenerHasValue = false; |
2486 return; | 2486 return; |
2487 } | 2487 } |
2488 | 2488 |
2489 if (dart.is(completeResult, Future)) { | 2489 if (dart.is(completeResult, Future)) { |
2490 let result = listener.result; | 2490 let result = listener.result; |
(...skipping 17 matching lines...) Expand all Loading... |
2508 listenerHasValue = handleValueCallback(); | 2508 listenerHasValue = handleValueCallback(); |
2509 } | 2509 } |
2510 } else { | 2510 } else { |
2511 handleError(); | 2511 handleError(); |
2512 } | 2512 } |
2513 if (dart.notNull(listener.handlesComplete)) { | 2513 if (dart.notNull(listener.handlesComplete)) { |
2514 handleWhenCompleteCallback(); | 2514 handleWhenCompleteCallback(); |
2515 } | 2515 } |
2516 if (oldZone != null) Zone._leave(oldZone); | 2516 if (oldZone != null) Zone._leave(oldZone); |
2517 if (isPropagationAborted) return; | 2517 if (isPropagationAborted) return; |
2518 if (dart.notNull(listenerHasValue) && !dart.notNull(core.identical(s
ourceValue, listenerValueOrError)) && dart.is(listenerValueOrError, Future)) { | 2518 if (dart.notNull(listenerHasValue) && !core.identical(sourceValue, l
istenerValueOrError) && dart.is(listenerValueOrError, Future)) { |
2519 let chainSource = dart.as(listenerValueOrError, Future); | 2519 let chainSource = dart.as(listenerValueOrError, Future); |
2520 let result = listener.result; | 2520 let result = listener.result; |
2521 if (dart.is(chainSource, _Future$())) { | 2521 if (dart.is(chainSource, _Future$())) { |
2522 if (dart.notNull(chainSource[_isComplete])) { | 2522 if (dart.notNull(chainSource[_isComplete])) { |
2523 result[_isChained] = true; | 2523 result[_isChained] = true; |
2524 source = chainSource; | 2524 source = chainSource; |
2525 listeners = new _FutureListener.chain(result); | 2525 listeners = new _FutureListener.chain(result); |
2526 continue; | 2526 continue; |
2527 } else { | 2527 } else { |
2528 _Future$()._chainCoreFuture(chainSource, result); | 2528 _Future$()._chainCoreFuture(chainSource, result); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2691 entry.next = exports._lastPriorityCallback.next; | 2691 entry.next = exports._lastPriorityCallback.next; |
2692 exports._lastPriorityCallback.next = entry; | 2692 exports._lastPriorityCallback.next = entry; |
2693 exports._lastPriorityCallback = entry; | 2693 exports._lastPriorityCallback = entry; |
2694 if (entry.next == null) { | 2694 if (entry.next == null) { |
2695 exports._lastCallback = entry; | 2695 exports._lastCallback = entry; |
2696 } | 2696 } |
2697 } | 2697 } |
2698 } | 2698 } |
2699 dart.fn(_schedulePriorityAsyncCallback, dart.void, [dart.dynamic]); | 2699 dart.fn(_schedulePriorityAsyncCallback, dart.void, [dart.dynamic]); |
2700 function scheduleMicrotask(callback) { | 2700 function scheduleMicrotask(callback) { |
2701 if (dart.notNull(core.identical(_ROOT_ZONE, Zone.current))) { | 2701 if (core.identical(_ROOT_ZONE, Zone.current)) { |
2702 _rootScheduleMicrotask(null, null, _ROOT_ZONE, callback); | 2702 _rootScheduleMicrotask(null, null, _ROOT_ZONE, callback); |
2703 return; | 2703 return; |
2704 } | 2704 } |
2705 Zone.current.scheduleMicrotask(Zone.current.bindCallback(callback, {runGuard
ed: true})); | 2705 Zone.current.scheduleMicrotask(Zone.current.bindCallback(callback, {runGuard
ed: true})); |
2706 } | 2706 } |
2707 dart.fn(scheduleMicrotask, dart.void, [dart.functionType(dart.void, [])]); | 2707 dart.fn(scheduleMicrotask, dart.void, [dart.functionType(dart.void, [])]); |
2708 class _AsyncRun extends core.Object { | 2708 class _AsyncRun extends core.Object { |
2709 static _scheduleImmediate(callback) { | 2709 static _scheduleImmediate(callback) { |
2710 dart.dcall(_AsyncRun.scheduleImmediateClosure, callback); | 2710 dart.dcall(_AsyncRun.scheduleImmediateClosure, callback); |
2711 } | 2711 } |
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4331 _addErrorWithReplacement(sink, e, s); | 4331 _addErrorWithReplacement(sink, e, s); |
4332 return; | 4332 return; |
4333 } | 4333 } |
4334 | 4334 |
4335 } | 4335 } |
4336 if (dart.notNull(matches)) { | 4336 if (dart.notNull(matches)) { |
4337 try { | 4337 try { |
4338 _invokeErrorHandler(this[_transform], error, stackTrace); | 4338 _invokeErrorHandler(this[_transform], error, stackTrace); |
4339 } catch (e) { | 4339 } catch (e) { |
4340 let s = dart.stackTrace(e); | 4340 let s = dart.stackTrace(e); |
4341 if (dart.notNull(core.identical(e, error))) { | 4341 if (core.identical(e, error)) { |
4342 sink[_addError](error, stackTrace); | 4342 sink[_addError](error, stackTrace); |
4343 } else { | 4343 } else { |
4344 _addErrorWithReplacement(sink, e, s); | 4344 _addErrorWithReplacement(sink, e, s); |
4345 } | 4345 } |
4346 return; | 4346 return; |
4347 } | 4347 } |
4348 | 4348 |
4349 } else { | 4349 } else { |
4350 sink[_addError](error, stackTrace); | 4350 sink[_addError](error, stackTrace); |
4351 } | 4351 } |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4489 const _DistinctStream$ = dart.generic(function(T) { | 4489 const _DistinctStream$ = dart.generic(function(T) { |
4490 class _DistinctStream extends _ForwardingStream$(T, T) { | 4490 class _DistinctStream extends _ForwardingStream$(T, T) { |
4491 _DistinctStream(source, equals) { | 4491 _DistinctStream(source, equals) { |
4492 this[_previous] = _DistinctStream$()._SENTINEL; | 4492 this[_previous] = _DistinctStream$()._SENTINEL; |
4493 this[_equals] = equals; | 4493 this[_equals] = equals; |
4494 super._ForwardingStream(source); | 4494 super._ForwardingStream(source); |
4495 } | 4495 } |
4496 [_handleData](inputEvent, sink) { | 4496 [_handleData](inputEvent, sink) { |
4497 dart.as(inputEvent, T); | 4497 dart.as(inputEvent, T); |
4498 dart.as(sink, _EventSink$(T)); | 4498 dart.as(sink, _EventSink$(T)); |
4499 if (dart.notNull(core.identical(this[_previous], _DistinctStream$()._SEN
TINEL))) { | 4499 if (core.identical(this[_previous], _DistinctStream$()._SENTINEL)) { |
4500 this[_previous] = inputEvent; | 4500 this[_previous] = inputEvent; |
4501 return sink[_add](inputEvent); | 4501 return sink[_add](inputEvent); |
4502 } else { | 4502 } else { |
4503 let isEqual = null; | 4503 let isEqual = null; |
4504 try { | 4504 try { |
4505 if (this[_equals] == null) { | 4505 if (this[_equals] == null) { |
4506 isEqual = dart.equals(this[_previous], inputEvent); | 4506 isEqual = dart.equals(this[_previous], inputEvent); |
4507 } else { | 4507 } else { |
4508 isEqual = this[_equals](dart.as(this[_previous], T), inputEvent); | 4508 isEqual = this[_equals](dart.as(this[_previous], T), inputEvent); |
4509 } | 4509 } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4619 this[_addError](e, s); | 4619 this[_addError](e, s); |
4620 } | 4620 } |
4621 | 4621 |
4622 } | 4622 } |
4623 [_handleError](error, stackTrace) { | 4623 [_handleError](error, stackTrace) { |
4624 if (stackTrace === void 0) stackTrace = null; | 4624 if (stackTrace === void 0) stackTrace = null; |
4625 try { | 4625 try { |
4626 this[_transformerSink].addError(error, dart.as(stackTrace, core.StackT
race)); | 4626 this[_transformerSink].addError(error, dart.as(stackTrace, core.StackT
race)); |
4627 } catch (e) { | 4627 } catch (e) { |
4628 let s = dart.stackTrace(e); | 4628 let s = dart.stackTrace(e); |
4629 if (dart.notNull(core.identical(e, error))) { | 4629 if (core.identical(e, error)) { |
4630 this[_addError](error, dart.as(stackTrace, core.StackTrace)); | 4630 this[_addError](error, dart.as(stackTrace, core.StackTrace)); |
4631 } else { | 4631 } else { |
4632 this[_addError](e, s); | 4632 this[_addError](e, s); |
4633 } | 4633 } |
4634 } | 4634 } |
4635 | 4635 |
4636 } | 4636 } |
4637 [_handleDone]() { | 4637 [_handleDone]() { |
4638 try { | 4638 try { |
4639 this[_subscription] = null; | 4639 this[_subscription] = null; |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4977 }); | 4977 }); |
4978 class ZoneDelegate extends core.Object {} | 4978 class ZoneDelegate extends core.Object {} |
4979 class Zone extends core.Object { | 4979 class Zone extends core.Object { |
4980 _() { | 4980 _() { |
4981 } | 4981 } |
4982 static get current() { | 4982 static get current() { |
4983 return Zone._current; | 4983 return Zone._current; |
4984 } | 4984 } |
4985 static _enter(zone) { | 4985 static _enter(zone) { |
4986 dart.assert(zone != null); | 4986 dart.assert(zone != null); |
4987 dart.assert(!dart.notNull(core.identical(zone, Zone._current))); | 4987 dart.assert(!core.identical(zone, Zone._current)); |
4988 let previous = Zone._current; | 4988 let previous = Zone._current; |
4989 Zone._current = zone; | 4989 Zone._current = zone; |
4990 return previous; | 4990 return previous; |
4991 } | 4991 } |
4992 static _leave(previous) { | 4992 static _leave(previous) { |
4993 dart.assert(previous != null); | 4993 dart.assert(previous != null); |
4994 Zone._current = previous; | 4994 Zone._current = previous; |
4995 } | 4995 } |
4996 } | 4996 } |
4997 dart.defineNamedConstructor(Zone, '_'); | 4997 dart.defineNamedConstructor(Zone, '_'); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5067 return dart.as(dart.dcall(implementation.function, implZone, _parentDelega
te(implZone), zone, f), ZoneUnaryCallback); | 5067 return dart.as(dart.dcall(implementation.function, implZone, _parentDelega
te(implZone), zone, f), ZoneUnaryCallback); |
5068 } | 5068 } |
5069 registerBinaryCallback(zone, f) { | 5069 registerBinaryCallback(zone, f) { |
5070 let implementation = this[_delegationTarget][_registerBinaryCallback]; | 5070 let implementation = this[_delegationTarget][_registerBinaryCallback]; |
5071 let implZone = implementation.zone; | 5071 let implZone = implementation.zone; |
5072 return dart.as(dart.dcall(implementation.function, implZone, _parentDelega
te(implZone), zone, f), ZoneBinaryCallback); | 5072 return dart.as(dart.dcall(implementation.function, implZone, _parentDelega
te(implZone), zone, f), ZoneBinaryCallback); |
5073 } | 5073 } |
5074 errorCallback(zone, error, stackTrace) { | 5074 errorCallback(zone, error, stackTrace) { |
5075 let implementation = this[_delegationTarget][_errorCallback]; | 5075 let implementation = this[_delegationTarget][_errorCallback]; |
5076 let implZone = implementation.zone; | 5076 let implZone = implementation.zone; |
5077 if (dart.notNull(core.identical(implZone, _ROOT_ZONE))) return null; | 5077 if (core.identical(implZone, _ROOT_ZONE)) return null; |
5078 return dart.as(dart.dcall(implementation.function, implZone, _parentDelega
te(implZone), zone, error, stackTrace), AsyncError); | 5078 return dart.as(dart.dcall(implementation.function, implZone, _parentDelega
te(implZone), zone, error, stackTrace), AsyncError); |
5079 } | 5079 } |
5080 scheduleMicrotask(zone, f) { | 5080 scheduleMicrotask(zone, f) { |
5081 let implementation = this[_delegationTarget][_scheduleMicrotask]; | 5081 let implementation = this[_delegationTarget][_scheduleMicrotask]; |
5082 let implZone = implementation.zone; | 5082 let implZone = implementation.zone; |
5083 dart.dcall(implementation.function, implZone, _parentDelegate(implZone), z
one, f); | 5083 dart.dcall(implementation.function, implZone, _parentDelegate(implZone), z
one, f); |
5084 } | 5084 } |
5085 createTimer(zone, duration, f) { | 5085 createTimer(zone, duration, f) { |
5086 let implementation = this[_delegationTarget][_createTimer]; | 5086 let implementation = this[_delegationTarget][_createTimer]; |
5087 let implZone = implementation.zone; | 5087 let implZone = implementation.zone; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5119 createTimer: [Timer, [Zone, core.Duration, dart.functionType(dart.void, []
)]], | 5119 createTimer: [Timer, [Zone, core.Duration, dart.functionType(dart.void, []
)]], |
5120 createPeriodicTimer: [Timer, [Zone, core.Duration, dart.functionType(dart.
void, [Timer])]], | 5120 createPeriodicTimer: [Timer, [Zone, core.Duration, dart.functionType(dart.
void, [Timer])]], |
5121 print: [dart.void, [Zone, core.String]], | 5121 print: [dart.void, [Zone, core.String]], |
5122 fork: [Zone, [Zone, ZoneSpecification, core.Map]] | 5122 fork: [Zone, [Zone, ZoneSpecification, core.Map]] |
5123 }) | 5123 }) |
5124 }); | 5124 }); |
5125 class _Zone extends core.Object { | 5125 class _Zone extends core.Object { |
5126 _Zone() { | 5126 _Zone() { |
5127 } | 5127 } |
5128 inSameErrorZone(otherZone) { | 5128 inSameErrorZone(otherZone) { |
5129 return dart.notNull(core.identical(this, otherZone)) || dart.notNull(core.
identical(this.errorZone, otherZone.errorZone)); | 5129 return core.identical(this, otherZone) || core.identical(this.errorZone, o
therZone.errorZone); |
5130 } | 5130 } |
5131 } | 5131 } |
5132 _Zone[dart.implements] = () => [Zone]; | 5132 _Zone[dart.implements] = () => [Zone]; |
5133 dart.setSignature(_Zone, { | 5133 dart.setSignature(_Zone, { |
5134 constructors: () => ({_Zone: [_Zone, []]}), | 5134 constructors: () => ({_Zone: [_Zone, []]}), |
5135 methods: () => ({inSameErrorZone: [core.bool, [Zone]]}) | 5135 methods: () => ({inSameErrorZone: [core.bool, [Zone]]}) |
5136 }); | 5136 }); |
5137 const _delegateCache = Symbol('_delegateCache'); | 5137 const _delegateCache = Symbol('_delegateCache'); |
5138 const _map = Symbol('_map'); | 5138 const _map = Symbol('_map'); |
5139 class _CustomZone extends _Zone { | 5139 class _CustomZone extends _Zone { |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5291 registerBinaryCallback(f) { | 5291 registerBinaryCallback(f) { |
5292 let implementation = this[_registerBinaryCallback]; | 5292 let implementation = this[_registerBinaryCallback]; |
5293 dart.assert(implementation != null); | 5293 dart.assert(implementation != null); |
5294 let parentDelegate = _parentDelegate(implementation.zone); | 5294 let parentDelegate = _parentDelegate(implementation.zone); |
5295 return dart.as(dart.dcall(implementation.function, implementation.zone, pa
rentDelegate, this, f), ZoneBinaryCallback); | 5295 return dart.as(dart.dcall(implementation.function, implementation.zone, pa
rentDelegate, this, f), ZoneBinaryCallback); |
5296 } | 5296 } |
5297 errorCallback(error, stackTrace) { | 5297 errorCallback(error, stackTrace) { |
5298 let implementation = this[_errorCallback]; | 5298 let implementation = this[_errorCallback]; |
5299 dart.assert(implementation != null); | 5299 dart.assert(implementation != null); |
5300 let implementationZone = implementation.zone; | 5300 let implementationZone = implementation.zone; |
5301 if (dart.notNull(core.identical(implementationZone, _ROOT_ZONE))) return n
ull; | 5301 if (core.identical(implementationZone, _ROOT_ZONE)) return null; |
5302 let parentDelegate = _parentDelegate(dart.as(implementationZone, _Zone)); | 5302 let parentDelegate = _parentDelegate(dart.as(implementationZone, _Zone)); |
5303 return dart.as(dart.dcall(implementation.function, implementationZone, par
entDelegate, this, error, stackTrace), AsyncError); | 5303 return dart.as(dart.dcall(implementation.function, implementationZone, par
entDelegate, this, error, stackTrace), AsyncError); |
5304 } | 5304 } |
5305 scheduleMicrotask(f) { | 5305 scheduleMicrotask(f) { |
5306 let implementation = this[_scheduleMicrotask]; | 5306 let implementation = this[_scheduleMicrotask]; |
5307 dart.assert(implementation != null); | 5307 dart.assert(implementation != null); |
5308 let parentDelegate = _parentDelegate(implementation.zone); | 5308 let parentDelegate = _parentDelegate(implementation.zone); |
5309 return dart.dcall(implementation.function, implementation.zone, parentDele
gate, this, f); | 5309 return dart.dcall(implementation.function, implementation.zone, parentDele
gate, this, f); |
5310 } | 5310 } |
5311 createTimer(duration, f) { | 5311 createTimer(duration, f) { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5398 dart.fn(_rootRegisterUnaryCallback, ZoneUnaryCallback, [Zone, ZoneDelegate, Zo
ne, dart.functionType(dart.dynamic, [dart.dynamic])]); | 5398 dart.fn(_rootRegisterUnaryCallback, ZoneUnaryCallback, [Zone, ZoneDelegate, Zo
ne, dart.functionType(dart.dynamic, [dart.dynamic])]); |
5399 function _rootRegisterBinaryCallback(self, parent, zone, f) { | 5399 function _rootRegisterBinaryCallback(self, parent, zone, f) { |
5400 return f; | 5400 return f; |
5401 } | 5401 } |
5402 dart.fn(_rootRegisterBinaryCallback, ZoneBinaryCallback, [Zone, ZoneDelegate,
Zone, dart.functionType(dart.dynamic, [dart.dynamic, dart.dynamic])]); | 5402 dart.fn(_rootRegisterBinaryCallback, ZoneBinaryCallback, [Zone, ZoneDelegate,
Zone, dart.functionType(dart.dynamic, [dart.dynamic, dart.dynamic])]); |
5403 function _rootErrorCallback(self, parent, zone, error, stackTrace) { | 5403 function _rootErrorCallback(self, parent, zone, error, stackTrace) { |
5404 return null; | 5404 return null; |
5405 } | 5405 } |
5406 dart.fn(_rootErrorCallback, AsyncError, [Zone, ZoneDelegate, Zone, core.Object
, core.StackTrace]); | 5406 dart.fn(_rootErrorCallback, AsyncError, [Zone, ZoneDelegate, Zone, core.Object
, core.StackTrace]); |
5407 function _rootScheduleMicrotask(self, parent, zone, f) { | 5407 function _rootScheduleMicrotask(self, parent, zone, f) { |
5408 if (!dart.notNull(core.identical(_ROOT_ZONE, zone))) { | 5408 if (!core.identical(_ROOT_ZONE, zone)) { |
5409 let hasErrorHandler = !dart.notNull(_ROOT_ZONE.inSameErrorZone(zone)); | 5409 let hasErrorHandler = !dart.notNull(_ROOT_ZONE.inSameErrorZone(zone)); |
5410 f = zone.bindCallback(f, {runGuarded: hasErrorHandler}); | 5410 f = zone.bindCallback(f, {runGuarded: hasErrorHandler}); |
5411 } | 5411 } |
5412 _scheduleAsyncCallback(f); | 5412 _scheduleAsyncCallback(f); |
5413 } | 5413 } |
5414 dart.fn(_rootScheduleMicrotask, dart.void, [Zone, ZoneDelegate, Zone, dart.fun
ctionType(dart.dynamic, [])]); | 5414 dart.fn(_rootScheduleMicrotask, dart.void, [Zone, ZoneDelegate, Zone, dart.fun
ctionType(dart.dynamic, [])]); |
5415 function _rootCreateTimer(self, parent, zone, duration, callback) { | 5415 function _rootCreateTimer(self, parent, zone, duration, callback) { |
5416 if (!dart.notNull(core.identical(_ROOT_ZONE, zone))) { | 5416 if (!core.identical(_ROOT_ZONE, zone)) { |
5417 callback = zone.bindCallback(callback); | 5417 callback = zone.bindCallback(callback); |
5418 } | 5418 } |
5419 return Timer._createTimer(duration, callback); | 5419 return Timer._createTimer(duration, callback); |
5420 } | 5420 } |
5421 dart.fn(_rootCreateTimer, Timer, [Zone, ZoneDelegate, Zone, core.Duration, dar
t.functionType(dart.void, [])]); | 5421 dart.fn(_rootCreateTimer, Timer, [Zone, ZoneDelegate, Zone, core.Duration, dar
t.functionType(dart.void, [])]); |
5422 function _rootCreatePeriodicTimer(self, parent, zone, duration, callback) { | 5422 function _rootCreatePeriodicTimer(self, parent, zone, duration, callback) { |
5423 if (!dart.notNull(core.identical(_ROOT_ZONE, zone))) { | 5423 if (!core.identical(_ROOT_ZONE, zone)) { |
5424 callback = dart.as(zone.bindUnaryCallback(callback), __CastType25); | 5424 callback = dart.as(zone.bindUnaryCallback(callback), __CastType25); |
5425 } | 5425 } |
5426 return Timer._createPeriodicTimer(duration, callback); | 5426 return Timer._createPeriodicTimer(duration, callback); |
5427 } | 5427 } |
5428 dart.fn(_rootCreatePeriodicTimer, Timer, [Zone, ZoneDelegate, Zone, core.Durat
ion, dart.functionType(dart.void, [Timer])]); | 5428 dart.fn(_rootCreatePeriodicTimer, Timer, [Zone, ZoneDelegate, Zone, core.Durat
ion, dart.functionType(dart.void, [Timer])]); |
5429 function _rootPrint(self, parent, zone, line) { | 5429 function _rootPrint(self, parent, zone, line) { |
5430 _internal.printToConsole(line); | 5430 _internal.printToConsole(line); |
5431 } | 5431 } |
5432 dart.fn(_rootPrint, dart.void, [Zone, ZoneDelegate, Zone, core.String]); | 5432 dart.fn(_rootPrint, dart.void, [Zone, ZoneDelegate, Zone, core.String]); |
5433 function _printToZone(line) { | 5433 function _printToZone(line) { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5547 } | 5547 } |
5548 get [_delegate]() { | 5548 get [_delegate]() { |
5549 if (_RootZone._rootDelegate != null) return _RootZone._rootDelegate; | 5549 if (_RootZone._rootDelegate != null) return _RootZone._rootDelegate; |
5550 return _RootZone._rootDelegate = new _ZoneDelegate(this); | 5550 return _RootZone._rootDelegate = new _ZoneDelegate(this); |
5551 } | 5551 } |
5552 get errorZone() { | 5552 get errorZone() { |
5553 return this; | 5553 return this; |
5554 } | 5554 } |
5555 runGuarded(f) { | 5555 runGuarded(f) { |
5556 try { | 5556 try { |
5557 if (dart.notNull(core.identical(_ROOT_ZONE, Zone._current))) { | 5557 if (core.identical(_ROOT_ZONE, Zone._current)) { |
5558 return f(); | 5558 return f(); |
5559 } | 5559 } |
5560 return _rootRun(null, null, this, f); | 5560 return _rootRun(null, null, this, f); |
5561 } catch (e) { | 5561 } catch (e) { |
5562 let s = dart.stackTrace(e); | 5562 let s = dart.stackTrace(e); |
5563 return this.handleUncaughtError(e, s); | 5563 return this.handleUncaughtError(e, s); |
5564 } | 5564 } |
5565 | 5565 |
5566 } | 5566 } |
5567 runUnaryGuarded(f, arg) { | 5567 runUnaryGuarded(f, arg) { |
5568 try { | 5568 try { |
5569 if (dart.notNull(core.identical(_ROOT_ZONE, Zone._current))) { | 5569 if (core.identical(_ROOT_ZONE, Zone._current)) { |
5570 return dart.dcall(f, arg); | 5570 return dart.dcall(f, arg); |
5571 } | 5571 } |
5572 return _rootRunUnary(null, null, this, f, arg); | 5572 return _rootRunUnary(null, null, this, f, arg); |
5573 } catch (e) { | 5573 } catch (e) { |
5574 let s = dart.stackTrace(e); | 5574 let s = dart.stackTrace(e); |
5575 return this.handleUncaughtError(e, s); | 5575 return this.handleUncaughtError(e, s); |
5576 } | 5576 } |
5577 | 5577 |
5578 } | 5578 } |
5579 runBinaryGuarded(f, arg1, arg2) { | 5579 runBinaryGuarded(f, arg1, arg2) { |
5580 try { | 5580 try { |
5581 if (dart.notNull(core.identical(_ROOT_ZONE, Zone._current))) { | 5581 if (core.identical(_ROOT_ZONE, Zone._current)) { |
5582 return dart.dcall(f, arg1, arg2); | 5582 return dart.dcall(f, arg1, arg2); |
5583 } | 5583 } |
5584 return _rootRunBinary(null, null, this, f, arg1, arg2); | 5584 return _rootRunBinary(null, null, this, f, arg1, arg2); |
5585 } catch (e) { | 5585 } catch (e) { |
5586 let s = dart.stackTrace(e); | 5586 let s = dart.stackTrace(e); |
5587 return this.handleUncaughtError(e, s); | 5587 return this.handleUncaughtError(e, s); |
5588 } | 5588 } |
5589 | 5589 |
5590 } | 5590 } |
5591 bindCallback(f, opts) { | 5591 bindCallback(f, opts) { |
(...skipping 25 matching lines...) Expand all Loading... |
5617 } | 5617 } |
5618 handleUncaughtError(error, stackTrace) { | 5618 handleUncaughtError(error, stackTrace) { |
5619 return _rootHandleUncaughtError(null, null, this, error, stackTrace); | 5619 return _rootHandleUncaughtError(null, null, this, error, stackTrace); |
5620 } | 5620 } |
5621 fork(opts) { | 5621 fork(opts) { |
5622 let specification = opts && 'specification' in opts ? opts.specification :
null; | 5622 let specification = opts && 'specification' in opts ? opts.specification :
null; |
5623 let zoneValues = opts && 'zoneValues' in opts ? opts.zoneValues : null; | 5623 let zoneValues = opts && 'zoneValues' in opts ? opts.zoneValues : null; |
5624 return _rootFork(null, null, this, specification, zoneValues); | 5624 return _rootFork(null, null, this, specification, zoneValues); |
5625 } | 5625 } |
5626 run(f) { | 5626 run(f) { |
5627 if (dart.notNull(core.identical(Zone._current, _ROOT_ZONE))) return f(); | 5627 if (core.identical(Zone._current, _ROOT_ZONE)) return f(); |
5628 return _rootRun(null, null, this, f); | 5628 return _rootRun(null, null, this, f); |
5629 } | 5629 } |
5630 runUnary(f, arg) { | 5630 runUnary(f, arg) { |
5631 if (dart.notNull(core.identical(Zone._current, _ROOT_ZONE))) return dart.d
call(f, arg); | 5631 if (core.identical(Zone._current, _ROOT_ZONE)) return dart.dcall(f, arg); |
5632 return _rootRunUnary(null, null, this, f, arg); | 5632 return _rootRunUnary(null, null, this, f, arg); |
5633 } | 5633 } |
5634 runBinary(f, arg1, arg2) { | 5634 runBinary(f, arg1, arg2) { |
5635 if (dart.notNull(core.identical(Zone._current, _ROOT_ZONE))) return dart.d
call(f, arg1, arg2); | 5635 if (core.identical(Zone._current, _ROOT_ZONE)) return dart.dcall(f, arg1,
arg2); |
5636 return _rootRunBinary(null, null, this, f, arg1, arg2); | 5636 return _rootRunBinary(null, null, this, f, arg1, arg2); |
5637 } | 5637 } |
5638 registerCallback(f) { | 5638 registerCallback(f) { |
5639 return f; | 5639 return f; |
5640 } | 5640 } |
5641 registerUnaryCallback(f) { | 5641 registerUnaryCallback(f) { |
5642 return f; | 5642 return f; |
5643 } | 5643 } |
5644 registerBinaryCallback(f) { | 5644 registerBinaryCallback(f) { |
5645 return f; | 5645 return f; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5700 let errorHandler = null; | 5700 let errorHandler = null; |
5701 if (onError != null) { | 5701 if (onError != null) { |
5702 errorHandler = dart.fn((self, parent, zone, error, stackTrace) => { | 5702 errorHandler = dart.fn((self, parent, zone, error, stackTrace) => { |
5703 try { | 5703 try { |
5704 if (dart.is(onError, ZoneBinaryCallback)) { | 5704 if (dart.is(onError, ZoneBinaryCallback)) { |
5705 return self.parent.runBinary(onError, error, stackTrace); | 5705 return self.parent.runBinary(onError, error, stackTrace); |
5706 } | 5706 } |
5707 return self.parent.runUnary(dart.as(onError, __CastType27), error); | 5707 return self.parent.runUnary(dart.as(onError, __CastType27), error); |
5708 } catch (e) { | 5708 } catch (e) { |
5709 let s = dart.stackTrace(e); | 5709 let s = dart.stackTrace(e); |
5710 if (dart.notNull(core.identical(e, error))) { | 5710 if (core.identical(e, error)) { |
5711 return parent.handleUncaughtError(zone, error, stackTrace); | 5711 return parent.handleUncaughtError(zone, error, stackTrace); |
5712 } else { | 5712 } else { |
5713 return parent.handleUncaughtError(zone, e, s); | 5713 return parent.handleUncaughtError(zone, e, s); |
5714 } | 5714 } |
5715 } | 5715 } |
5716 | 5716 |
5717 }, dart.dynamic, [Zone, ZoneDelegate, Zone, dart.dynamic, core.StackTrace]
); | 5717 }, dart.dynamic, [Zone, ZoneDelegate, Zone, dart.dynamic, core.StackTrace]
); |
5718 } | 5718 } |
5719 if (zoneSpecification == null) { | 5719 if (zoneSpecification == null) { |
5720 zoneSpecification = ZoneSpecification.new({handleUncaughtError: errorHandl
er}); | 5720 zoneSpecification = ZoneSpecification.new({handleUncaughtError: errorHandl
er}); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5779 exports.ScheduleMicrotaskHandler = ScheduleMicrotaskHandler; | 5779 exports.ScheduleMicrotaskHandler = ScheduleMicrotaskHandler; |
5780 exports.CreateTimerHandler = CreateTimerHandler; | 5780 exports.CreateTimerHandler = CreateTimerHandler; |
5781 exports.CreatePeriodicTimerHandler = CreatePeriodicTimerHandler; | 5781 exports.CreatePeriodicTimerHandler = CreatePeriodicTimerHandler; |
5782 exports.PrintHandler = PrintHandler; | 5782 exports.PrintHandler = PrintHandler; |
5783 exports.ForkHandler = ForkHandler; | 5783 exports.ForkHandler = ForkHandler; |
5784 exports.ZoneSpecification = ZoneSpecification; | 5784 exports.ZoneSpecification = ZoneSpecification; |
5785 exports.ZoneDelegate = ZoneDelegate; | 5785 exports.ZoneDelegate = ZoneDelegate; |
5786 exports.Zone = Zone; | 5786 exports.Zone = Zone; |
5787 exports.runZoned = runZoned; | 5787 exports.runZoned = runZoned; |
5788 }); | 5788 }); |
OLD | NEW |