LibWeb: Update structured deserialization to accept its target realm

This is a formal parameter to this AO in the spec.
This commit is contained in:
Timothy Flynn 2025-04-17 08:57:55 -04:00 committed by Tim Flynn
parent 0c309d4660
commit 5eab109d85
Notes: github-actions[bot] 2025-04-17 17:47:42 +00:00
4 changed files with 9 additions and 8 deletions

View file

@ -324,11 +324,11 @@ void MessagePort::post_message_task_steps(SerializedTransferRecord& serialize_wi
// 2. Let targetRealm be finalTargetPort's relevant realm.
auto& target_realm = relevant_realm(*final_target_port);
auto& target_vm = target_realm.vm();
TemporaryExecutionContext context { target_realm };
// 3. Let deserializeRecord be StructuredDeserializeWithTransfer(serializeWithTransferResult, targetRealm).
TemporaryExecutionContext context { relevant_realm(*final_target_port) };
auto deserialize_record_or_error = structured_deserialize_with_transfer(target_vm, serialize_with_transfer_result);
auto deserialize_record_or_error = structured_deserialize_with_transfer(serialize_with_transfer_result, target_realm);
if (deserialize_record_or_error.is_error()) {
// If this throws an exception, catch it, fire an event named messageerror at finalTargetPort, using MessageEvent, and then return.
auto exception = deserialize_record_or_error.release_error();