| Index: sdk/lib/async/zone.dart
|
| diff --git a/sdk/lib/async/zone.dart b/sdk/lib/async/zone.dart
|
| index bea3fc24b1ef6f245b169b59bc1eed7ffa415881..655aefda5b4a313aeb5d80b908c980320e5050a0 100644
|
| --- a/sdk/lib/async/zone.dart
|
| +++ b/sdk/lib/async/zone.dart
|
| @@ -130,6 +130,11 @@ abstract class _Zone {
|
| * This usually means that the [child] has finished executing and is done.
|
| */
|
| void _removeChild(_Zone child);
|
| +
|
| + /**
|
| + * True if this is the default zone, otherwise false.
|
| + */
|
| + bool get isDefault;
|
| }
|
|
|
| /**
|
| @@ -157,6 +162,8 @@ class _ZoneBase implements _Zone {
|
| assert(this is _DefaultZone);
|
| }
|
|
|
| + bool get isDefault => false;
|
| +
|
| _Zone get _errorZone => _parentZone._errorZone;
|
|
|
| void handleUncaughtError(error) {
|
| @@ -321,6 +328,8 @@ class _ZoneBase implements _Zone {
|
| class _DefaultZone extends _ZoneBase {
|
| _DefaultZone() : super._defaultZone();
|
|
|
| + bool get isDefault => true;
|
| +
|
| _Zone get _errorZone => this;
|
|
|
| handleUncaughtError(error) {
|
| @@ -556,3 +565,16 @@ runZonedExperimental(body(),
|
| _CatchErrorsZone zone = new _CatchErrorsZone(_Zone._current, onError, onDone);
|
| return zone.runWaitForCompletion(body);
|
| }
|
| +
|
| +/**
|
| + * Gets the current zone. See [runZonedExperimental].
|
| + *
|
| + * *Warning*: all Zone APIs are subject to change. Your code may break in the
|
| + * future with [NoSuchMethodError] or cause have other unexpected behavior.
|
| + */
|
| +// TODO(jmesserly): how do we expose only the features that dart:html needs?
|
| +// Crazy idea: move EventStreamSubscription to be an abstract base class in
|
| +// dart:async (possibly renaming it) and make the calls to add and remove the
|
| +// listener abstract. Then dart:html overrides it to use DOM addEventListener
|
| +// and removeEventListener.
|
| +get currentZoneExperimental => _Zone.current;
|
|
|