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

Unified Diff: utils/pub/utils.dart

Issue 13196007: Replace defer() with Future.of in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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/pub.dart ('k') | 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 7460891490da08e5f2206f0cf4852461e54cfe63..cb316cbebbb763b2fcd0724b029ec0e77189e62b 100644
--- a/utils/pub/utils.dart
+++ b/utils/pub/utils.dart
@@ -145,18 +145,6 @@ String sha1(String source) {
return CryptoUtils.bytesToHex(sha.close());
}
-// TODO(nweiz): Use Future.of instead of this wherever we don't actually need
-// asynchrony.
-/// Invokes the given callback asynchronously. Returns a [Future] that completes
-/// to the result of [callback].
-///
-/// This is also used to wrap synchronous code that may thrown an exception to
-/// ensure that methods that have both sync and async code only report errors
-/// asynchronously.
-Future defer(callback()) {
- return new Future.immediate(null).then((_) => callback());
-}
-
/// Returns a [Future] that completes in [milliseconds].
Future sleep(int milliseconds) {
var completer = new Completer();
« no previous file with comments | « utils/pub/pub.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698