Open Bug 1478710 Opened 2 years ago Updated 2 years ago
Firefox should warn when adding an object with no handle
Event function as an Event Listener from Java Script
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36 Steps to reproduce: Call addEventListener passing the an object with no handleEvent function as a the handler. Simple example - https://jsfiddle.net/rh162f8b/18/ In our actual application, we were passing undefined as the handler and a library we used was wrapping that in in an object and passing the wrapped object to addEventListener. Actual results: A TypeError with description "Property 'handleEvent' is not callable" is thrown when the event is triggered. However, nothing is logged the event listener is added. The error is not helpful as it gives no clue which event is triggering this and where the event listener was added. Expected results: Noting which element & event triggered the error in the description would be helpful. Even better would be logging some type of warning when calling addEventListener with an object without handleEvent.
Component: Event Handling → DOM
Product: Core → DevTools
Component: DOM → DOM: Events
Product: DevTools → Core
Component: DOM: Events → DOM
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.