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

Unified Diff: lib/isolate/serialization.dart

Issue 10690142: Move function serialization to sync ports. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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
« no previous file with comments | « lib/html/src/Isolates.dart ('k') | tests/html/js_interop_func_passing_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/isolate/serialization.dart
diff --git a/lib/isolate/serialization.dart b/lib/isolate/serialization.dart
index 4eef8a3f0b7746690c52b522d4fbd8648a1fe6d9..b3cb136eafa562f9702efc417bc01966d5bc5d3a 100644
--- a/lib/isolate/serialization.dart
+++ b/lib/isolate/serialization.dart
@@ -37,6 +37,7 @@ class _MessageTraverser {
if (x is Map) return visitMap(x);
if (x is SendPort) return visitSendPort(x);
if (x is SendPortSync) return visitSendPortSync(x);
+ if (x is Function) return visitFunction(x);
// TODO(floitsch): make this a real exception. (which one)?
throw "Message serialization: Illegal value $x passed";
@@ -48,6 +49,10 @@ class _MessageTraverser {
abstract visitSendPort(SendPort x);
abstract visitSendPortSync(SendPortSync x);
+ visitFunction(Function func) {
+ throw "Serialization of functions is not allowed.";
+ }
+
static bool isPrimitive(x) {
return (x === null) || (x is String) || (x is num) || (x is bool);
}
« no previous file with comments | « lib/html/src/Isolates.dart ('k') | tests/html/js_interop_func_passing_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698