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

Unified Diff: sdk/lib/async/future.dart

Issue 1992713002: Make Iterable.generate use ListIterable as base implementation. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Reword skip docs Created 4 years, 7 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 | « no previous file | sdk/lib/core/iterable.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/future.dart
diff --git a/sdk/lib/async/future.dart b/sdk/lib/async/future.dart
index 0ca0e924ba3e189e199af8bc8c98db4e39d4d1e4..e0e06174f4043ade4d72fc30ba945fc492e9f30a 100644
--- a/sdk/lib/async/future.dart
+++ b/sdk/lib/async/future.dart
@@ -363,18 +363,19 @@ abstract class Future<T> {
}
/**
- * Perform an async operation repeatedly until it returns `false`.
+ * Performs an async operation repeatedly until it returns `false`.
*
- * Runs [f] repeatedly, starting the next iteration only when the [Future]
- * returned by [f] completes to `true`. Returns a [Future] that completes once
- * [f] returns `false`.
+ * The function [f] is called repeatedly while it returns either the [bool]
+ * value `true` or a [Future] which completes with the value `true`.
*
- * The return values of all [Future]s are discarded. Any errors will cause the
- * iteration to stop and will be piped through the returned [Future].
+ * If a call to [f] returns `false` or a [Future] that completes to `false`,
+ * iteration ends and the future returned by [doWhile] is completed.
*
- * The function [f] may return either a [bool] or a [Future] that completes to
- * a [bool]. If it returns a non-[Future], iteration continues immediately.
- * Otherwise it waits for the returned [Future] to complete.
+ * If a future returned by [f] completes with an error, iteration ends and
+ * the future returned by [doWhile] completes with the same error.
+ *
+ * The [f] function must return either a `bool` value or a [Future] completing
+ * with a `bool` value.
*/
static Future doWhile(f()) {
_Future doneSignal = new _Future();
« no previous file with comments | « no previous file | sdk/lib/core/iterable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698