| Index: sdk/lib/async/event_loop.dart
|
| diff --git a/sdk/lib/async/event_loop.dart b/sdk/lib/async/event_loop.dart
|
| index 9462460ecee20605358ec6f0bd7d8e6ae8abd039..94137da655b61c61739078757e06e6c8a36c0a9d 100644
|
| --- a/sdk/lib/async/event_loop.dart
|
| +++ b/sdk/lib/async/event_loop.dart
|
| @@ -55,8 +55,14 @@ void _scheduleAsyncCallback(callback) {
|
| * }
|
| */
|
| void runAsync(void callback()) {
|
| - _Zone currentZone = _Zone._current;
|
| - currentZone.runAsync(callback, currentZone);
|
| + if (Zone.current == Zone.ROOT) {
|
| + // No need to bind the callback. We know that the root's runAsync will
|
| + // be invoked in the root zone.
|
| + Zone.current.scheduleMicrotask(callback);
|
| + return;
|
| + }
|
| + Zone.current.scheduleMicrotask(
|
| + Zone.current.bindCallback(callback, runGuarded: true));
|
| }
|
|
|
| class _AsyncRun {
|
|
|