[JSC] SerializedScriptValue.create() succeeds even if MessagePort object cannot be found in transferred ports
https://bugs.webkit.org/show_bug.cgi?id=87118
Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-05-30
Reviewed by Adam Barth.
Source/WebCore:
Make SerializedScriptValue.create() throw an exception if one of the
MessagePort objects cannot be found in the transferred ports. This
matches the behavior of the V8 implementation.
Test: webintents/web-intents-obj-constructor.html
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpIfTerminal):
LayoutTests:
Unskip webintents/web-intents-obj-constructor.html now that
SerializedScriptValue.create() throws an exception if one of the
MessagePort objects cannot be found in the transferred ports.
* platform/efl/test_expectations.txt:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119027 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/bindings/js/SerializedScriptValue.cpp b/Source/WebCore/bindings/js/SerializedScriptValue.cpp
index 970c850..c25f768 100644
--- a/Source/WebCore/bindings/js/SerializedScriptValue.cpp
+++ b/Source/WebCore/bindings/js/SerializedScriptValue.cpp
@@ -634,7 +634,9 @@
write(index->second);
return true;
}
- return false;
+ // MessagePort object could not be found in transferred message ports
+ code = ValidationError;
+ return true;
}
if (obj->inherits(&JSArrayBuffer::s_info)) {
RefPtr<ArrayBuffer> arrayBuffer = toArrayBuffer(obj);