Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Unified Diff: sdk/lib/async/zone.dart

Issue 702413002: Revert "Convert _propagateToListeners to using an external stack instead of recursion." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/async/future_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/zone.dart
diff --git a/sdk/lib/async/zone.dart b/sdk/lib/async/zone.dart
index 5880df81141dcd4865d35711e8aa32b5040b43f3..d22f5ba832f5a6ef4e1dbc53fbc784d3ad34fc95 100644
--- a/sdk/lib/async/zone.dart
+++ b/sdk/lib/async/zone.dart
@@ -448,6 +448,7 @@ abstract class Zone {
*/
static Zone _enter(Zone zone) {
assert(zone != null);
+ assert(!identical(zone, _current));
Zone previous = _current;
_current = zone;
return previous;
@@ -1077,18 +1078,10 @@ class _RootZone extends _Zone {
dynamic runGuarded(f()) {
try {
- Zone current = Zone._current;
- if (identical(current, _ROOT_ZONE) ||
- identical(current, this)) {
- return f();
- }
-
- Zone old = Zone._enter(this);
- try {
+ if (identical(_ROOT_ZONE, Zone._current)) {
return f();
- } finally {
- Zone._leave(old);
}
+ return _rootRun(null, null, this, f);
} catch (e, s) {
return handleUncaughtError(e, s);
}
@@ -1154,18 +1147,8 @@ class _RootZone extends _Zone {
}
dynamic run(f()) {
- Zone current = Zone._current;
- if (identical(current, _ROOT_ZONE) ||
- identical(current, this)) {
- return f();
- }
-
- Zone old = Zone._enter(this);
- try {
- return f();
- } finally {
- Zone._leave(old);
- }
+ if (identical(Zone._current, _ROOT_ZONE)) return f();
+ return _rootRun(null, null, this, f);
}
dynamic runUnary(f(arg), arg) {
« no previous file with comments | « sdk/lib/async/future_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698