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

Unified Diff: utils/tests/pub/test_pub.dart

Issue 11414069: Make mappedBy lazy. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Reupload due to error. Created 8 years, 1 month 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
« runtime/lib/growable_array.dart ('K') | « utils/tests/archive/reader_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/test_pub.dart
diff --git a/utils/tests/pub/test_pub.dart b/utils/tests/pub/test_pub.dart
index 8ffabbc66d0ef22c857629661c035cc441750404..e5d994356a8ce0368341d5bb7440d15e45d5e3a8 100644
--- a/utils/tests/pub/test_pub.dart
+++ b/utils/tests/pub/test_pub.dart
@@ -910,7 +910,8 @@ class DirectoryDescriptor extends Descriptor {
if (contents == null) return new Future<Directory>.immediate(dir);
// Recursively create all of its children.
- final childFutures = contents.mappedBy((child) => child.create(dir));
+ final childFutures =
+ contents.mappedBy((child) => child.create(dir)).toList();
// Only complete once all of the children have been created too.
return Futures.wait(childFutures).transform((_) => dir);
});
@@ -933,7 +934,8 @@ class DirectoryDescriptor extends Descriptor {
Future validate(String path) {
return _validateOneMatch(path, (dir) {
// Validate each of the items in this directory.
- final entryFutures = contents.mappedBy((entry) => entry.validate(dir));
+ final entryFutures =
+ contents.mappedBy((entry) => entry.validate(dir)).toList();
// If they are all valid, the directory is valid.
return Futures.wait(entryFutures).transform((entries) => null);
@@ -1198,7 +1200,9 @@ class NothingDescriptor extends Descriptor {
Future _awaitObject(object) {
// Unroll nested futures.
if (object is Future) return object.chain(_awaitObject);
- if (object is Collection) return Futures.wait(object.mappedBy(_awaitObject));
+ if (object is Collection) {
+ return Futures.wait(object.mappedBy(_awaitObject).toList());
+ }
if (object is! Map) return new Future.immediate(object);
var pairs = <Future<Pair>>[];
« runtime/lib/growable_array.dart ('K') | « utils/tests/archive/reader_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698