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

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

Issue 11794047: Remove generic typedefs that dart2js chokes on. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update status files for non-browser tests Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | dart/sdk/lib/async/stream_impl.dart » ('j') | no next file with comments »
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 deprecatedFutureValue(_FutureImpl future) => 7 deprecatedFutureValue(_FutureImpl future) =>
8 future._isComplete ? future._resultOrListeners : null; 8 future._isComplete ? future._resultOrListeners : null;
9 9
10 10
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 /** The onValue and onError handlers return either a value or a future */ 317 /** The onValue and onError handlers return either a value or a future */
318 typedef dynamic _FutureOnValue<T>(T value); 318 typedef dynamic _FutureOnValue<T>(T value);
319 typedef dynamic _FutureOnError(AsyncError error); 319 typedef dynamic _FutureOnError(AsyncError error);
320 /** Test used by [Future.catchError] to handle skip some errors. */ 320 /** Test used by [Future.catchError] to handle skip some errors. */
321 typedef bool _FutureErrorTest(var error); 321 typedef bool _FutureErrorTest(var error);
322 /** Used by [WhenFuture]. */ 322 /** Used by [WhenFuture]. */
323 typedef void _FutureAction(); 323 typedef void _FutureAction();
324 324
325 /** Future returned by [Future.then] with no [:onError:] parameter. */ 325 /** Future returned by [Future.then] with no [:onError:] parameter. */
326 class _ThenFuture<S, T> extends _TransformFuture<S, T> { 326 class _ThenFuture<S, T> extends _TransformFuture<S, T> {
327 final _FutureOnValue<S> _onValue; 327 // TODO(ahe): Restore type when feature is implemented in dart2js
328 // checked mode.
329 final /* _FutureOnValue<S> */ _onValue;
328 330
329 _ThenFuture(this._onValue); 331 _ThenFuture(this._onValue);
330 332
331 _sendValue(S value) { 333 _sendValue(S value) {
332 assert(_onValue != null); 334 assert(_onValue != null);
333 var result; 335 var result;
334 try { 336 try {
335 result = _onValue(value); 337 result = _onValue(value);
336 } catch (e, s) { 338 } catch (e, s) {
337 _setError(new AsyncError(e, s)); 339 _setError(new AsyncError(e, s));
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 Future catchError(function(AsyncError error), {bool test(var error)}) { 453 Future catchError(function(AsyncError error), {bool test(var error)}) {
452 return _future.catchError(function, test: test); 454 return _future.catchError(function, test: test);
453 } 455 }
454 456
455 Future whenComplete(void action()) { 457 Future whenComplete(void action()) {
456 return _future.whenComplete(action); 458 return _future.whenComplete(action);
457 } 459 }
458 460
459 Stream<T> asStream() => new Stream.fromFuture(this); 461 Stream<T> asStream() => new Stream.fromFuture(this);
460 } 462 }
OLDNEW
« no previous file with comments | « no previous file | dart/sdk/lib/async/stream_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698