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

Unified Diff: utils/pub/utils.dart

Issue 11778108: Stop working around issue 7790 in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months 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 | « utils/pub/oauth2.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/utils.dart
diff --git a/utils/pub/utils.dart b/utils/pub/utils.dart
index 1ab0bc6cdc1b06e68439de4c78005432171a831d..e605579417e03737af720af397a178cef7321229 100644
--- a/utils/pub/utils.dart
+++ b/utils/pub/utils.dart
@@ -118,26 +118,6 @@ void chainToCompleter(Future future, Completer completer) {
onError: (e) => completer.completeError(e.error, e.stackTrace));
}
-// TODO(nweiz): remove this when issue 7790 is fixed.
-/// Like [Future.whenComplete], except that [action] may return a [Future]. If
-/// it does, the returned [Future] won't complete until [action]'s [Future]
-/// completes.
-///
-/// The returned [Future] always has the same value as [future].
-Future asyncWhenComplete(Future future, Future action()) {
- Future futurify(Future future) {
- if (future != null) return future;
- return new Future.immediate(null);
- }
-
- return future.then((result) => futurify(action()).then((_) => result),
- onError: (e) {
- return futurify(action()).then((_) {
- throw e;
- });
- });
-}
-
// TODO(nweiz): unify the following functions with the utility functions in
// pkg/http.
« no previous file with comments | « utils/pub/oauth2.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698