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

Unified Diff: sdk/lib/_internal/pub/lib/src/dart.dart

Issue 88783002: Isolate.spawn{Uri} only reports errors asynchronously. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 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 | « sdk/lib/_internal/lib/isolate_patch.dart ('k') | tests/co19/co19-co19.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/dart.dart
diff --git a/sdk/lib/_internal/pub/lib/src/dart.dart b/sdk/lib/_internal/pub/lib/src/dart.dart
index bf6cb2a169b369c20a89b7934aa84c10a212da8a..03bd0451c6dc46b89a47f0bfcaf855cc28d081b8 100644
--- a/sdk/lib/_internal/pub/lib/src/dart.dart
+++ b/sdk/lib/_internal/pub/lib/src/dart.dart
@@ -127,11 +127,9 @@ Future runInIsolate(String code, message) {
/// Adding an additional isolate in the middle works around this.
void _isolateBuffer(message) {
var replyTo = message['replyTo'];
- // TODO(floitsch): If we do it right we shouldn't need to capture synchronous
- // errors.
- new Future.sync(() {
- return Isolate.spawnUri(Uri.parse(message['uri']), [], message['message']);
- }).then((_) => replyTo.send({'type': 'success'})).catchError((e, stack) {
+ Isolate.spawnUri(Uri.parse(message['uri']), [], message['message'])
+ .then((_) => replyTo.send({'type': 'success'}))
+ .catchError((e, stack) {
replyTo.send({
'type': 'error',
'error': CrossIsolateException.serialize(e, stack)
« no previous file with comments | « sdk/lib/_internal/lib/isolate_patch.dart ('k') | tests/co19/co19-co19.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698