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

Side by Side Diff: corelib/src/implementation/future_implementation.dart

Issue 9359050: futures: add more types to chain/transform, some additional cleanup. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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 | « corelib/src/future.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 Google Inc. All Rights Reserved. 1 // Copyright 2011 Google Inc. All Rights Reserved.
2 // Dart core library. 2 // Dart core library.
3 3
4 /**
5 * Thrown if client tries to obtain value or exception
6 * before a future has completed.
7 */
8 class FutureNotCompleteException implements Exception {
9 FutureNotCompleteException() {}
10 String toString() => "Exception: future has not been completed";
11 }
12
13 /**
14 * Thrown if a completer tries to set the value on
15 * a future that is already complete.
16 */
17 class FutureAlreadyCompleteException implements Exception {
18 FutureAlreadyCompleteException() {}
19 String toString() => "Exception: future already completed";
20 }
21
22
23 class FutureImpl<T> implements Future<T> { 4 class FutureImpl<T> implements Future<T> {
24 5
25 bool _isComplete; 6 bool _isComplete;
26 7
27 /** 8 /**
28 * Value that was provided to this Future by the Completer 9 * Value that was provided to this Future by the Completer
29 */ 10 */
30 T _value; 11 T _value;
31 12
32 /** 13 /**
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 } 174 }
194 175
195 void complete(T value) { 176 void complete(T value) {
196 _futureImpl._setValue(value); 177 _futureImpl._setValue(value);
197 } 178 }
198 179
199 void completeException(var exception) { 180 void completeException(var exception) {
200 _futureImpl._setException(exception); 181 _futureImpl._setException(exception);
201 } 182 }
202 } 183 }
OLDNEW
« no previous file with comments | « corelib/src/future.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698