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

Side by Side Diff: tool/input_sdk/lib/async/future_impl.dart

Issue 1554683002: Update to latest analyzer (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 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
« no previous file with comments | « tool/input_sdk/lib/async/future.dart ('k') | tool/input_sdk/lib/async/stream.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 /** The onValue and onError handlers return either a value or a future */ 7 /** The onValue and onError handlers return either a value or a future */
8 typedef dynamic _FutureOnValue<T>(T value); 8 typedef dynamic _FutureOnValue<T>(T value);
9 /** Test used by [Future.catchError] to handle skip some errors. */ 9 /** Test used by [Future.catchError] to handle skip some errors. */
10 typedef bool _FutureErrorTest(var error); 10 typedef bool _FutureErrorTest(var error);
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 set _isChained(bool value) { 195 set _isChained(bool value) {
196 if (value) { 196 if (value) {
197 assert(!_isComplete); 197 assert(!_isComplete);
198 _state = _CHAINED; 198 _state = _CHAINED;
199 } else { 199 } else {
200 assert(_isChained); 200 assert(_isChained);
201 _state = _INCOMPLETE; 201 _state = _INCOMPLETE;
202 } 202 }
203 } 203 }
204 204
205 Future then(f(T value), { Function onError }) { 205 Future/*<S>*/ then/*<S>*/(/*=S*/ f(T value), { Function onError }) {
206 _Future result = new _Future(); 206 _Future/*<S>*/ result = new _Future();
207 if (!identical(result._zone, _ROOT_ZONE)) { 207 if (!identical(result._zone, _ROOT_ZONE)) {
208 f = result._zone.registerUnaryCallback(f); 208 f = result._zone.registerUnaryCallback(f);
209 if (onError != null) { 209 if (onError != null) {
210 onError = _registerErrorHandler(onError, result._zone); 210 onError = _registerErrorHandler(onError, result._zone);
211 } 211 }
212 } 212 }
213 _addListener(new _FutureListener.then(result, f, onError)); 213 _addListener(new _FutureListener.then(result, f, onError));
214 return result; 214 return result;
215 } 215 }
216 216
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 } 642 }
643 }, onError: (e, s) { 643 }, onError: (e, s) {
644 if (timer.isActive) { 644 if (timer.isActive) {
645 timer.cancel(); 645 timer.cancel();
646 result._completeError(e, s); 646 result._completeError(e, s);
647 } 647 }
648 }); 648 });
649 return result; 649 return result;
650 } 650 }
651 } 651 }
OLDNEW
« no previous file with comments | « tool/input_sdk/lib/async/future.dart ('k') | tool/input_sdk/lib/async/stream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698