Chromium Code Reviews

Unified Diff: pkg/barback/lib/src/utils.dart

Issue 19841002: Remove calls to [new Future] work around issue 11911. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review change. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « pkg/barback/lib/src/transform.dart ('k') | pkg/barback/test/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/utils.dart
diff --git a/pkg/barback/lib/src/utils.dart b/pkg/barback/lib/src/utils.dart
index 9da4b0e71d74b0de28c6b678526195dfd72c5747..7529fa974d580e91bd4b23531d43b02e7552e40a 100644
--- a/pkg/barback/lib/src/utils.dart
+++ b/pkg/barback/lib/src/utils.dart
@@ -101,3 +101,6 @@ Future pumpEventQueue([int times=20]) {
return new Future.delayed(Duration.ZERO, () => pumpEventQueue(times - 1));
}
+/// Like [new Future], but avoids issue 11911 by using [new Future.value] under
+/// the covers.
+Future newFuture(callback()) => new Future.value().then((_) => callback());
« no previous file with comments | « pkg/barback/lib/src/transform.dart ('k') | pkg/barback/test/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine