OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of "async.dart"; | 5 part of dart.async; |
6 | 6 |
7 typedef R ZoneCallback<R>(); | 7 typedef R ZoneCallback<R>(); |
8 typedef R ZoneUnaryCallback<R, T>(T arg); | 8 typedef R ZoneUnaryCallback<R, T>(T arg); |
9 typedef R ZoneBinaryCallback<R, T1, T2>(T1 arg1, T2 arg2); | 9 typedef R ZoneBinaryCallback<R, T1, T2>(T1 arg1, T2 arg2); |
10 | 10 |
11 // TODO(floitsch): we are abusing generic typedefs as typedefs for generic | 11 // TODO(floitsch): we are abusing generic typedefs as typedefs for generic |
12 // functions. | 12 // functions. |
13 /*ABUSE*/ | 13 /*ABUSE*/ |
14 typedef R HandleUncaughtErrorHandler<R>( | 14 typedef R HandleUncaughtErrorHandler<R>( |
15 Zone self, ZoneDelegate parent, Zone zone, error, StackTrace stackTrace); | 15 Zone self, ZoneDelegate parent, Zone zone, error, StackTrace stackTrace); |
(...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1460 handleUncaughtError: errorHandler); | 1460 handleUncaughtError: errorHandler); |
1461 } | 1461 } |
1462 Zone zone = Zone.current | 1462 Zone zone = Zone.current |
1463 .fork(specification: zoneSpecification, zoneValues: zoneValues); | 1463 .fork(specification: zoneSpecification, zoneValues: zoneValues); |
1464 if (onError != null) { | 1464 if (onError != null) { |
1465 return zone.runGuarded(body); | 1465 return zone.runGuarded(body); |
1466 } else { | 1466 } else { |
1467 return zone.run(body); | 1467 return zone.run(body); |
1468 } | 1468 } |
1469 } | 1469 } |
OLD | NEW |