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); |
} |