Index: src/value-serializer.cc |
diff --git a/src/value-serializer.cc b/src/value-serializer.cc |
index b0ecc6ddd5f1d10916fd4225ddf1873e68aeb210..edbc75795fa17dffe7aaee88d0eb03411d50aab4 100644 |
--- a/src/value-serializer.cc |
+++ b/src/value-serializer.cc |
@@ -349,7 +349,8 @@ Maybe<bool> ValueSerializer::WriteJSReceiver(Handle<JSReceiver> receiver) { |
// Eliminate callable and exotic objects, which should not be serialized. |
InstanceType instance_type = receiver->map()->instance_type(); |
- if (receiver->IsCallable() || instance_type <= LAST_SPECIAL_RECEIVER_TYPE) { |
+ if (receiver->IsCallable() || (instance_type <= LAST_SPECIAL_RECEIVER_TYPE && |
+ instance_type != JS_SPECIAL_API_OBJECT_TYPE)) { |
ThrowDataCloneError(MessageTemplate::kDataCloneError, receiver); |
return Nothing<bool>(); |
} |
@@ -367,6 +368,8 @@ Maybe<bool> ValueSerializer::WriteJSReceiver(Handle<JSReceiver> receiver) { |
return js_object->GetInternalFieldCount() ? WriteHostObject(js_object) |
: WriteJSObject(js_object); |
} |
+ case JS_SPECIAL_API_OBJECT_TYPE: |
+ return WriteHostObject(Handle<JSObject>::cast(receiver)); |
case JS_DATE_TYPE: |
WriteJSDate(JSDate::cast(*receiver)); |
return Just(true); |