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

Unified Diff: sdk/lib/isolate/base.dart

Issue 12886011: Add unhandledExceptionCallback to streamSpawnFunction. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 7 years, 9 months 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/isolate/base.dart
diff --git a/sdk/lib/isolate/base.dart b/sdk/lib/isolate/base.dart
index 73b550cff4cb825e1b40fd1f5dce01dae4968a27..519cf49b7581e0bb390b375f5de80a6f90b7d550 100644
--- a/sdk/lib/isolate/base.dart
+++ b/sdk/lib/isolate/base.dart
@@ -31,11 +31,16 @@ ReceivePort get port => _Isolate.port;
* [spawnFunction] returns a [SendPort] derived from the child isolate's default
* port.
*
+ * The optional [unhandledExceptionCallback] argument is invoked whenever an
+ * exception inside the isolate is unhandled. It can be seen as a big
+ * `try/catch` around everything that is executed inside the isolate. The
+ * callback should return `true` when it was able to handled the exception.
+ *
* See comments at the top of this library for more details.
*/
SendPort spawnFunction(void topLevelFunction(),
- [bool UnhandledExceptionCallback(IsolateUnhandledException e)])
- => _Isolate.spawnFunction(topLevelFunction, UnhandledExceptionCallback);
+ [bool unhandledExceptionCallback(IsolateUnhandledException e)])
+ => _Isolate.spawnFunction(topLevelFunction, unhandledExceptionCallback);
/**
* Creates and spawns an isolate whose code is available at [uri]. Like with
@@ -171,7 +176,7 @@ abstract class SendPortSync {
abstract class _Isolate {
external static ReceivePort get port;
external static SendPort spawnFunction(void topLevelFunction(),
- [bool UnhandledExceptionCallback(IsolateUnhandledException e)]);
+ [bool unhandledExceptionCallback(IsolateUnhandledException e)]);
external static SendPort spawnUri(String uri);
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/lib/isolate_patch.dart ('k') | sdk/lib/isolate/isolate_stream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698