| 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;
|
| }
|
| }
|
|
|
|
|