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

Unified Diff: utils/pub/utils.dart

Issue 11783052: Fix chainToCompleter. (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 | « no previous file | utils/tests/pub/test_pub.dart » ('j') | 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 9094984adcf3d37cd926fc35546b61e243c9a735..e27382af3cac019c1cbceaf859e394ac90a1ebdb 100644
--- a/utils/pub/utils.dart
+++ b/utils/pub/utils.dart
@@ -120,11 +120,9 @@ Future sleep(int milliseconds) {
/// Configures [future] so that its result (success or exception) is passed on
/// to [completer].
void chainToCompleter(Future future, Completer completer) {
- future
- .then(completer.complete)
- .catchError((e) {
- completer.completeError(e.error, e.stackTrace);
- });
+ future.then((value) => completer.complete(value),
+ onError: (e) =>completer.completeError(e.error, e.stackTrace));
nweiz 2013/01/09 02:24:50 Nit: need a space between "=>" and "completer".
Bob Nystrom 2013/01/09 02:26:41 Oopsie. Done.
+
nweiz 2013/01/09 02:24:50 Extra line
Bob Nystrom 2013/01/09 02:26:41 Done.
}
// TODO(nweiz): unify the following functions with the utility functions in
« no previous file with comments | « no previous file | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698