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

Unified Diff: sdk/lib/_internal/lib/isolate_helper.dart

Issue 93873014: Update isolate documentation. Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add isolateMessageException 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
Index: sdk/lib/_internal/lib/isolate_helper.dart
diff --git a/sdk/lib/_internal/lib/isolate_helper.dart b/sdk/lib/_internal/lib/isolate_helper.dart
index af5c9d55185f39e4c96c4ea28a46acce19f6f987..39ba791b17fcca66e9ceb8fa8876b9a9d23075f3 100644
--- a/sdk/lib/_internal/lib/isolate_helper.dart
+++ b/sdk/lib/_internal/lib/isolate_helper.dart
@@ -23,6 +23,13 @@ import 'dart:_interceptors' show JSExtendableArray;
ReceivePort controlPort;
+class IsolateDeserializationError extends Error {
+ final String _message;
+ IsolateDeserializationError(this._message);
+
+ toString() => "IsolateDeserializationError: $_message";
+}
+
/**
* Called by the compiler to support switching
* between isolates when we get a callback from the DOM.
@@ -1077,8 +1084,7 @@ class _MessageTraverser {
visitSendPort(SendPort x);
visitObject(Object x) {
- // TODO(floitsch): make this a real exception. (which one)?
- throw "Message serialization: Illegal value $x passed";
+ throw new IsolateMessageException("Illegal value $x passed");
Lasse Reichstein Nielsen 2013/12/11 10:38:28 Could we put the value of x into the object? If th
floitsch 2013/12/11 12:14:16 Yes. I would like that. The problem is that it wou
}
static bool isPrimitive(x) {
@@ -1233,8 +1239,7 @@ class _Deserializer {
deserializeSendPort(List x);
deserializeObject(List x) {
- // TODO(floitsch): Use real exception (which one?).
- throw "Unexpected serialized object";
+ throw new IsolateDeserializationError("Unexpected serialized object");
Lasse Reichstein Nielsen 2013/12/11 10:38:28 How does this error occur? It happens during dese
floitsch 2013/12/11 12:14:16 It's a sanity check, and could happen once we have
}
}
« no previous file with comments | « runtime/vm/symbols.h ('k') | sdk/lib/isolate/isolate.dart » ('j') | sdk/lib/isolate/isolate.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698