fix: re-throw errors in delegated event listeners (#2382)

This commit is contained in:
Giovanni 2024-03-07 21:48:21 +00:00 committed by GitHub
parent 372a241d78
commit 943a992570
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -150,7 +150,10 @@ pub(crate) fn add_delegated_event_listener(
if !maybe_handler.is_undefined() {
let f = maybe_handler
.unchecked_ref::<js_sys::Function>();
let _ = f.call1(&node, &ev);
if let Err(e) = f.call1(&node, &ev) {
wasm_bindgen::throw_val(e);
}
if ev.cancel_bubble() {
return;