From 6e3b816763b1d9dd191d6785ba5ac9b0ecee0254 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Tue, 19 Dec 2023 15:25:33 -0700 Subject: [PATCH] LibWeb: Represent transferred objects as an empty object This matches the behavior of the three major engines. --- Userland/Libraries/LibWeb/HTML/StructuredSerialize.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/StructuredSerialize.cpp b/Userland/Libraries/LibWeb/HTML/StructuredSerialize.cpp index 3529732ab9..6f5524f5b9 100644 --- a/Userland/Libraries/LibWeb/HTML/StructuredSerialize.cpp +++ b/Userland/Libraries/LibWeb/HTML/StructuredSerialize.cpp @@ -578,9 +578,8 @@ public: // 2. If memory[serialized] exists, then return memory[serialized]. if (tag == ValueTag::ObjectReference) { auto index = m_serialized[m_position++]; - // FIXME: For transferred items, find a way to avoid putting placeholders in the serialized data if (index == NumericLimits::max()) { - return JS::js_null(); + return JS::Object::create(*m_vm.current_realm(), nullptr); } return m_memory[index]; }