mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
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:
Notes:
github-actions[bot]
2025-04-17 17:47:42 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/5eab109d854 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4386
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user