Bug 37263

Summary: [v8] SerializedScriptValue fails to deserialize an Object that has prototype with properties
Product: WebKit Reporter: Yury Semikhatsky <yurys>
Component: WebCore JavaScriptAssignee: Yury Semikhatsky <yurys>
Status: RESOLVED FIXED    
Severity: Normal CC: pfeldman, vitalyr, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
proposed fix
none
patch
pfeldman: review+
patch pfeldman: review+

Description Yury Semikhatsky 2010-04-08 05:11:42 PDT
SerializedScriptValue fails to deserialize an Object that has prototype with properties. Try to serialize and the deserialize object with the following constructor:

InjectedScript.CallFrameProxy = function(id)
{
    this.id = id;
}

InjectedScript.CallFrameProxy.prototype = {
    _wrapScopeChain: function(callFrame)
    {}
}
Comment 1 Yury Semikhatsky 2010-04-08 05:15:31 PDT
Created attachment 52853 [details]
proposed fix
Comment 2 Yury Semikhatsky 2010-04-08 06:37:59 PDT
Created attachment 52857 [details]
patch
Comment 3 Yury Semikhatsky 2010-04-08 06:44:45 PDT
Created attachment 52859 [details]
patch

Moved    ++m_numSerializedProperties; after property names serialization according to vitalyr feedback.
Comment 4 Yury Semikhatsky 2010-04-08 07:28:49 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	LayoutTests/ChangeLog
	M	LayoutTests/fast/dom/Window/window-postmessage-clone-expected.txt
	M	LayoutTests/fast/dom/Window/window-postmessage-clone.html
	M	WebCore/ChangeLog
	M	WebCore/bindings/v8/SerializedScriptValue.cpp
Committed r57276
Comment 5 Vitaly Repeshko 2010-04-08 08:10:45 PDT
(In reply to comment #4)
> Committing to http://svn.webkit.org/repository/webkit/trunk ...
>     M    LayoutTests/ChangeLog
>     M    LayoutTests/fast/dom/Window/window-postmessage-clone-expected.txt
>     M    LayoutTests/fast/dom/Window/window-postmessage-clone.html
>     M    WebCore/ChangeLog
>     M    WebCore/bindings/v8/SerializedScriptValue.cpp
> Committed r57276

Thanks a lot for fixing this!