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

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: Fix dart2js. Created 7 years, 1 month 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
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 7e1fe28b23b20bff770e2a8d7751b6e766294471..f85ccffd2ea8a84e5111c6b969dd19ad91605384 100644
--- a/sdk/lib/_internal/pub/lib/src/dart.dart
+++ b/sdk/lib/_internal/pub/lib/src/dart.dart
@@ -123,11 +123,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)

Powered by Google App Engine
This is Rietveld 408576698