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

Unified Diff: pkg/scheduled_test/lib/src/descriptor/directory_descriptor.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: pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart
diff --git a/pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart b/pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart
index d07b5bc52dbec689ecce4c573201a7f331734a92..ea482ef794642b7f49fca59250963199a25cfe0f 100644
--- a/pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart
+++ b/pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart
@@ -46,7 +46,7 @@ class DirectoryDescriptor extends Descriptor {
}
return Future.wait(contents.map((entry) {
- return new Future.of(() => entry.validateNow(fullPath))
+ return new Future.sync(() => entry.validateNow(fullPath))
.then((_) => null)
.catchError((e) => e.error);
})).then((results) {
@@ -57,7 +57,7 @@ class DirectoryDescriptor extends Descriptor {
}
Stream<List<int>> load(String pathToLoad) {
- return futureStream(new Future.immediate(null).then((_) {
+ return futureStream(new Future.value().then((_) {
if (_path.isAbsolute(pathToLoad)) {
throw "Can't load absolute path '$pathToLoad'.";
}

Powered by Google App Engine
This is Rietveld 408576698