Chromium Code Reviews| 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 |