Index: tests/lib/async/zone_run_guarded_test.dart |
diff --git a/tests/lib/async/zone_run_guarded_test.dart b/tests/lib/async/zone_run_guarded_test.dart |
index 6b87bf14305f7ed253f7b32fb9360831a7323ddf..e7a752090e2243d449bff5750ffb5053008c0ec7 100644 |
--- a/tests/lib/async/zone_run_guarded_test.dart |
+++ b/tests/lib/async/zone_run_guarded_test.dart |
@@ -7,8 +7,6 @@ import 'package:async_helper/async_helper.dart'; |
import 'dart:async'; |
main() { |
- var result; |
- |
Completer done = new Completer(); |
List events = []; |
@@ -19,7 +17,7 @@ main() { |
Zone forked; |
forked = Zone.current.fork( |
specification: new ZoneSpecification( |
- run: <R>(Zone self, ZoneDelegate parent, Zone origin, R f()) { |
+ run: (Zone self, ZoneDelegate parent, Zone origin, f()) { |
// The zone is still the same as when origin.run was invoked, which |
// is the root zone. (The origin zone hasn't been set yet). |
Expect.identical(Zone.ROOT, Zone.current); |
@@ -30,19 +28,19 @@ main() { |
Expect.identical(Zone.ROOT, Zone.current); |
Expect.identical(forked, origin); |
events.add("forked.handleUncaught $error"); |
- result = 499; |
+ return 499; |
})); |
- forked.runGuarded(() { |
+ var result = forked.runGuarded(() { |
events.add("runGuarded 1"); |
Expect.identical(forked, Zone.current); |
- result = 42; |
+ return 42; |
}); |
Expect.identical(Zone.ROOT, Zone.current); |
Expect.equals(42, result); |
events.add("after runGuarded 1"); |
- forked.runGuarded(() { |
+ result = forked.runGuarded(() { |
events.add("runGuarded 2"); |
Expect.identical(forked, Zone.current); |
throw 42; |
@@ -58,10 +56,9 @@ main() { |
"forked.handleUncaught 42" |
], events); |
- result = null; |
events.clear(); |
asyncStart(); |
- forked.runGuarded(() { |
+ result = forked.runGuarded(() { |
Expect.identical(forked, Zone.current); |
events.add("run closure"); |
forked.scheduleMicrotask(() { |