Description
Describe the problem
I'm not sure this is a bug or the framework's intention.
According to the DOM API specification document
addEventListener(type, listener)
listener could be an object that has a handleEvent() method.
Ref: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
I tried writing the following code in the svelte REPL:
Svelte REPL: https://svelte.dev/repl/538e3dbe765947a9b0a04a88cb050c6a?version=3.55.1
Svelte compiler seems to work with listener objects via handleEvent(), but it produce different results when referencing by object name and "this" including to reactive ui.
Describe the proposed solution
svelte compiler should support addEventListener object with handleEvent()
Alternatives considered
svelte compiler should support addEventListener object with handleEvent()
Importance
nice to have