From a39f3faab5816c93948d6ea34b60a4e10a294e2f Mon Sep 17 00:00:00 2001 From: ldm0 Date: Wed, 16 Sep 2026 11:58:03 +0800 Subject: [PATCH] fix(events): preserve listener mutations during dispatch Track the exact registration represented by each dispatch snapshot and refresh active handlers before invoking them. Removing and re-adding the same callback no longer revives an entry from the current snapshot, while handler replacements use their current value and callback contexts. Share invocation preparation across simple event targets, worker threads, and Worker/SharedWorker host error dispatch. Remove once listeners before calling author code so a reentrant registration remains active. Cover listener replacement, abort, object callbacks, nested dispatch, realm retirement, and actual worker message and error delivery. --- moli-renderer-v8/src/script_vm/tests/browser_api/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/moli-renderer-v8/src/script_vm/tests/browser_api/mod.rs b/moli-renderer-v8/src/script_vm/tests/browser_api/mod.rs index a79f4f97412..f159880711f 100644 --- a/moli-renderer-v8/src/script_vm/tests/browser_api/mod.rs +++ b/moli-renderer-v8/src/script_vm/tests/browser_api/mod.rs @@ -85,6 +85,7 @@ mod service_worker_drain; mod session_description; mod shadow_root_init; mod simple_event_dispatch; +mod simple_event_dispatch; mod simple_event_target_handlers; mod simple_handler_object; mod speech_synthesis;