@@ -22,25 +22,37 @@ Stream catchErrors(dynamic body()) {
2222 return controller.stream;
2323}
2424
25- runZonedScheduleMicrotask (body (),
26- {void onScheduleMicrotask (void callback ())? , Function ? onError}) {
25+ runZonedScheduleMicrotask (
26+ body (), {
27+ void onScheduleMicrotask (void callback ())? ,
28+ Function ? onError,
29+ }) {
2730 if (onScheduleMicrotask == null ) {
2831 return runZonedGuarded (body, onError as void Function (Object , StackTrace ));
2932 }
3033 HandleUncaughtErrorHandler ? errorHandler;
3134 if (onError != null ) {
32- errorHandler = (Zone self, ZoneDelegate parent, Zone zone, error,
33- StackTrace stackTrace) {
34- try {
35- return self.parent! .runUnary (onError as void Function (Object ), error);
36- } catch (e, s) {
37- if (identical (e, error)) {
38- return parent.handleUncaughtError (zone, error, stackTrace);
39- } else {
40- return parent.handleUncaughtError (zone, e, s);
41- }
42- }
43- };
35+ errorHandler =
36+ (
37+ Zone self,
38+ ZoneDelegate parent,
39+ Zone zone,
40+ error,
41+ StackTrace stackTrace,
42+ ) {
43+ try {
44+ return self.parent! .runUnary (
45+ onError as void Function (Object ),
46+ error,
47+ );
48+ } catch (e, s) {
49+ if (identical (e, error)) {
50+ return parent.handleUncaughtError (zone, error, stackTrace);
51+ } else {
52+ return parent.handleUncaughtError (zone, e, s);
53+ }
54+ }
55+ };
4456 }
4557 ScheduleMicrotaskHandler ? asyncHandler;
4658 if (onScheduleMicrotask != null ) {
@@ -49,7 +61,9 @@ runZonedScheduleMicrotask(body(),
4961 };
5062 }
5163 ZoneSpecification specification = new ZoneSpecification (
52- handleUncaughtError: errorHandler, scheduleMicrotask: asyncHandler);
64+ handleUncaughtError: errorHandler,
65+ scheduleMicrotask: asyncHandler,
66+ );
5367 Zone zone = Zone .current.fork (specification: specification);
5468 if (onError != null ) {
5569 return zone.runGuarded (body);
0 commit comments