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

Unified Diff: corelib/src/implementation/future_implementation.dart

Issue 9007053: await in frog: partial support for try-catch blocks (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 9 years 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 | frog/await/transformation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: corelib/src/implementation/future_implementation.dart
diff --git a/corelib/src/implementation/future_implementation.dart b/corelib/src/implementation/future_implementation.dart
index 1cd2b349eaee324259695e3aa516f168f196a6ec..566fc92ffff65bf4efb4597b143bcd7a7b4ecbad 100644
--- a/corelib/src/implementation/future_implementation.dart
+++ b/corelib/src/implementation/future_implementation.dart
@@ -7,6 +7,7 @@
*/
class FutureNotCompleteException implements Exception {
FutureNotCompleteException() {}
+ String toString() => "Exception: future has not been completed";
}
/**
@@ -15,6 +16,7 @@ class FutureNotCompleteException implements Exception {
*/
class FutureAlreadyCompleteException implements Exception {
FutureAlreadyCompleteException() {}
+ String toString() => "Exception: future already completed";
}
@@ -81,8 +83,10 @@ class FutureImpl<T> implements Future<T> {
void then(void onComplete(T value)) {
if (hasValue) {
onComplete(value);
- } else {
+ } else if (!isComplete) {
_listeners.add(onComplete);
+ } else if (!_exceptionHandled) {
+ throw _exception;
}
}
« no previous file with comments | « no previous file | frog/await/transformation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698