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

Unified Diff: utils/pub/io.dart

Issue 14070010: Refactor Future constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
Index: utils/pub/io.dart
diff --git a/utils/pub/io.dart b/utils/pub/io.dart
index 8523d340527fef5169da484f9c0ebf3a30b2ce10..90b086cd23ec545c9c16f707e67ae57af9a4578e 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -548,9 +548,9 @@ Future timeout(Future input, int milliseconds, String description) {
/// Returns a future that completes to the value that the future returned from
/// [fn] completes to.
Future withTempDir(Future fn(String path)) {
- return new Future.of(() {
+ return new Future.sync(() {
var tempDir = createTempDir();
- return new Future.of(() => fn(tempDir))
+ return new Future.sync(() => fn(tempDir))
.whenComplete(() => deleteEntry(tempDir));
});
}

Powered by Google App Engine
This is Rietveld 408576698