1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:37:35 +00:00

LibWeb: Add initial implementation of structured clone

This implementation only works for cloning Numbers, and does not try to
do all the spec steps for structured serialize and deserialize.

Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
This commit is contained in:
Daniel Ehrenberg 2022-04-05 02:24:10 +02:00 committed by Andreas Kling
parent d94d60219c
commit 09841f56ed
5 changed files with 213 additions and 0 deletions

View file

@ -119,6 +119,7 @@ public:
WindowProxy* parent();
WebIDL::ExceptionOr<void> post_message_impl(JS::Value, String const& target_origin);
WebIDL::ExceptionOr<JS::Value> structured_clone_impl(JS::VM& vm, JS::Value);
String name() const;
void set_name(String const&);
@ -241,6 +242,7 @@ private:
JS_DECLARE_NATIVE_FUNCTION(outer_height_getter);
JS_DECLARE_NATIVE_FUNCTION(post_message);
JS_DECLARE_NATIVE_FUNCTION(structured_clone);
JS_DECLARE_NATIVE_FUNCTION(local_storage_getter);
JS_DECLARE_NATIVE_FUNCTION(session_storage_getter);