fix: call all event handlers even if an exception occurs in one
Error in Svelte event dispatcher is inconsistant with the browser event handling.
I think that Svelte should mimic the browser event handling : if an error occurs on an event-handler, it should be stopped, but it should not impact the others event-handlers.
Fixes https://github.com/sveltejs/svelte/issues/8403
Note that I try to write an unit-test, but it fails because of the exception on the handler, and I don't know how to ignore that.
Before submitting the PR, please make sure you do the following
- [X] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
- [X] Prefix your PR title with
feat:,fix:,chore:, ordocs:. - [X] This message body should clearly illustrate what problems it solves.
- [ ] Ideally, include a test that fails without this PR but passes with it.
Tests
- [X] Run the tests with
npm testand lint the project withnpm run lint
@adiguba is attempting to deploy a commit to the Svelte Team on Vercel.
A member of the Team first needs to authorize it.
Closing as we're no longer adding stuff to Svelte 4, but updated #8403 for Svelte 5