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

Side by Side Diff: sdk/lib/async/future.dart

Issue 2905013003: fix doc comments in dart:io and collection types (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | sdk/lib/collection/iterable.dart » ('j') | sdk/lib/collection/queue.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.async; 5 part of dart.async;
6 6
7 /// A type representing values that are either `Future<T>` or `T`. 7 /// A type representing values that are either `Future<T>` or `T`.
8 /// 8 ///
9 /// This class declaration is a public stand-in for an internal 9 /// This class declaration is a public stand-in for an internal
10 /// future-or-value generic type. References to this class are resolved to the 10 /// future-or-value generic type. References to this class are resolved to the
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 * 301 *
302 * If `eagerError` is true, the returned future completes with an error 302 * If `eagerError` is true, the returned future completes with an error
303 * immediately on the first error from one of the futures. Otherwise all 303 * immediately on the first error from one of the futures. Otherwise all
304 * futures must complete before the returned future is completed (still with 304 * futures must complete before the returned future is completed (still with
305 * the first error; the remaining errors are silently dropped). 305 * the first error; the remaining errors are silently dropped).
306 * 306 *
307 * In the case of an error, [cleanUp] (if provided), is invoked on any 307 * In the case of an error, [cleanUp] (if provided), is invoked on any
308 * non-null result of successful futures. 308 * non-null result of successful futures.
309 * This makes it posible to `cleanUp` resources that would otherwise be 309 * This makes it posible to `cleanUp` resources that would otherwise be
310 * lost (since the returned future does not provide access to these values). 310 * lost (since the returned future does not provide access to these values).
311 * The [cleanup] function is unused if there is no error. 311 * The [cleanUp] function is unused if there is no error.
312 * 312 *
313 * The call to `cleanUp` should not throw. If it does, the error will be an 313 * The call to `cleanUp` should not throw. If it does, the error will be an
314 * uncaught asynchronous error. 314 * uncaught asynchronous error.
315 */ 315 */
316 static Future<List<T>> wait<T>(Iterable<Future<T>> futures, 316 static Future<List<T>> wait<T>(Iterable<Future<T>> futures,
317 {bool eagerError: false, void cleanUp(T successValue)}) { 317 {bool eagerError: false, void cleanUp(T successValue)}) {
318 final _Future<List<T>> result = new _Future<List<T>>(); 318 final _Future<List<T>> result = new _Future<List<T>>();
319 List<T> values; // Collects the values. Set to null on error. 319 List<T> values; // Collects the values. Set to null on error.
320 int remaining = 0; // How many futures are we waiting for. 320 int remaining = 0; // How many futures are we waiting for.
321 var error; // The first error from a future. 321 var error; // The first error from a future.
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 AsyncError replacement = Zone.current.errorCallback(error, stackTrace); 887 AsyncError replacement = Zone.current.errorCallback(error, stackTrace);
888 if (replacement != null) { 888 if (replacement != null) {
889 error = _nonNullError(replacement.error); 889 error = _nonNullError(replacement.error);
890 stackTrace = replacement.stackTrace; 890 stackTrace = replacement.stackTrace;
891 } 891 }
892 result._asyncCompleteError(error, stackTrace); 892 result._asyncCompleteError(error, stackTrace);
893 } 893 }
894 894
895 /** Helper function that converts `null` to a [NullThrownError]. */ 895 /** Helper function that converts `null` to a [NullThrownError]. */
896 Object _nonNullError(Object error) => error ?? new NullThrownError(); 896 Object _nonNullError(Object error) => error ?? new NullThrownError();
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/collection/iterable.dart » ('j') | sdk/lib/collection/queue.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698