LibWeb: Represent transferred objects as an empty object

This matches the behavior of the three major engines.
This commit is contained in:
Andrew Kaster 2023-12-19 15:25:33 -07:00 committed by Andrew Kaster
parent cfcec5e18e
commit 6e3b816763
Notes: sideshowbarker 2024-07-18 04:38:32 +09:00

View File

@ -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<u32>::max()) {
return JS::js_null();
return JS::Object::create(*m_vm.current_realm(), nullptr);
}
return m_memory[index];
}