svelte icon indicating copy to clipboard operation
svelte copied to clipboard

fix: call all event handlers even if an exception occurs in one

Open adiguba opened this issue 2 years ago • 1 comments

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:, or docs:.
  • [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 test and lint the project with npm run lint

adiguba avatar Apr 01 '23 10:04 adiguba

@adiguba is attempting to deploy a commit to the Svelte Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Apr 01 '23 10:04 vercel[bot]

Closing as we're no longer adding stuff to Svelte 4, but updated #8403 for Svelte 5

Rich-Harris avatar Apr 01 '24 22:04 Rich-Harris