Ignore:
Timestamp:
Aug 23, 2012, 12:08:54 PM (13 years ago)
Author:
[email protected]
Message:

Serialization of JavaScript values does not appear to respect new HTML5 Structured Clone semantics
https://bugs.webkit.org/show_bug.cgi?id=65292

Patch by Christophe Dumez <Christophe Dumez> on 2012-08-23
Reviewed by Oliver Hunt.

Source/JavaScriptCore:

Add function to construct a StringObject from a JSValue.
Similar functions already exist for NumberObject and
BooleanObject for example.

Export several symbols so address linking errors in
WebCore.

  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  • runtime/BooleanObject.h:

(BooleanObject):

  • runtime/NumberObject.h:

(NumberObject):
(JSC):

  • runtime/StringObject.cpp:

(JSC::constructString):
(JSC):

  • runtime/StringObject.h:

(JSC):

Source/WebCore:

JSC now correctly serialize Boolean, Number and String objects as per
the structured clone algorithm specification. This patch reduces the
delta with the V8 implementation of SerializedScriptValue.

No new tests, already tested by fast/dom/Window/window-postmessage-clone.html

  • bindings/js/SerializedScriptValue.cpp:

(WebCore):
(WebCore::CloneSerializer::dumpStringObject):
(CloneSerializer):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::readTerminal):

LayoutTests:

Update expected results for fast/dom/Window/window-postmessage-clone.html
now that String, Boolean and Number object are correctly serialized with
JSC.

  • fast/dom/Window/window-postmessage-clone-expected.txt:
  • platform/gtk/fast/dom/Window/window-postmessage-clone-expected.txt:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/NumberObject.h

    r103243 r126464  
    4141        }
    4242
    43         static const ClassInfo s_info;
     43        static JS_EXPORTDATA const ClassInfo s_info;
    4444
    4545        static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
     
    4949    };
    5050
    51     NumberObject* constructNumber(ExecState*, JSGlobalObject*, JSValue);
     51    JS_EXPORT_PRIVATE NumberObject* constructNumber(ExecState*, JSGlobalObject*, JSValue);
    5252
    5353} // namespace JSC
Note: See TracChangeset for help on using the changeset viewer.