| Index: sdk/lib/async/event_loop.dart
|
| diff --git a/sdk/lib/async/event_loop.dart b/sdk/lib/async/event_loop.dart
|
| index 2802e40d55ec75e41a0426a65abe5babd6b642c1..bc0a63818b90aa0164a12d0039be8d377b2f270f 100644
|
| --- a/sdk/lib/async/event_loop.dart
|
| +++ b/sdk/lib/async/event_loop.dart
|
| @@ -18,13 +18,23 @@ void _asyncRunCallback() {
|
| callback();
|
| } catch (e) {
|
| _AsyncRun._enqueueImmediate(_asyncRunCallback);
|
| - throw;
|
| + rethrow;
|
| }
|
| }
|
| // Any new callback must register a callback function now.
|
| _callbacksAreEnqueued = false;
|
| }
|
|
|
| +void _scheduleAsyncCallback(callback) {
|
| + // Optimizing a group of Timer.run callbacks to be executed in the
|
| + // same Timer callback.
|
| + _asyncCallbacks.add(callback);
|
| + if (!_callbacksAreEnqueued) {
|
| + _AsyncRun._enqueueImmediate(_asyncRunCallback);
|
| + _callbacksAreEnqueued = true;
|
| + }
|
| +}
|
| +
|
| /**
|
| * Runs the given [callback] asynchronously.
|
| *
|
| @@ -45,13 +55,7 @@ void _asyncRunCallback() {
|
| * }
|
| */
|
| void runAsync(void callback()) {
|
| - // Optimizing a group of Timer.run callbacks to be executed in the
|
| - // same Timer callback.
|
| - _asyncCallbacks.add(callback);
|
| - if (!_callbacksAreEnqueued) {
|
| - _AsyncRun._enqueueImmediate(_asyncRunCallback);
|
| - _callbacksAreEnqueued = true;
|
| - }
|
| + _Zone._current.runAsync(callback);
|
| }
|
|
|
| class _AsyncRun {
|
|
|