Chromium Code Reviews| Index: runtime/lib/isolate_patch.dart |
| diff --git a/runtime/lib/isolate_patch.dart b/runtime/lib/isolate_patch.dart |
| index 3792a5b4d2ddbdee1d72446d80c67cae5cd82062..e0e7693b4eeac17d1750b546980b59a234954c40 100644 |
| --- a/runtime/lib/isolate_patch.dart |
| +++ b/runtime/lib/isolate_patch.dart |
| @@ -241,8 +241,11 @@ patch class Isolate { |
| completer.complete(new Isolate._fromControlPort(controlPort)); |
| }; |
| } catch(e, st) { |
| - // TODO(14718): we want errors to go into the returned future. |
| - rethrow; |
| + // Don't complete immediately with an error, since the caller didn't |
| + // yet have the opportunity to install an error handler. |
| + scheduleMicrotask(() { |
| + completer.completeError(e, st); |
| + }); |
|
Lasse Reichstein Nielsen
2013/12/13 11:16:58
How about doing the same as in the JS patch:
try
floitsch
2013/12/13 12:13:37
Done.
|
| }; |
| return completer.future; |
| } |
| @@ -261,8 +264,11 @@ patch class Isolate { |
| completer.complete(new Isolate._fromControlPort(controlPort)); |
| }; |
| } catch(e, st) { |
| - // TODO(14718): we want errors to go into the returned future. |
| - rethrow; |
| + // Don't complete immediately with an error, since the caller didn't |
| + // yet have the opportunity to install an error handler. |
| + scheduleMicrotask(() { |
| + completer.completeError(e, st); |
| + }); |
| }; |
| return completer.future; |
| } |