Bug 1519597 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Mike Ratcliffe [:miker] [:mratcliffe] [:mikeratcliffe] from comment #2)

> @jimb I agree that we should avoid using empty catch blocks and totally understand your frustration but we have had so many different situations come up where this blows up that this seemed the safest thing to do.
> 
> This is a difficult one to solve because using an object as a listener is completely fine e.g.
> 
> ```js
> var obj = {
>   handleEvent(e) {
>     console.log(this === obj);
>   }
> };
> 
> document.body.addEventListener('click', obj);
> ```
> 
> I'll take a look... maybe we can do this better.
> 
> If I remember rightly, the melon that broke the monkey's back was when I discovered that some event listeners are not even JS but are somehow C++.
> 
> I will add something to log a warning so we can at least see what went wrong.
(In reply to Mike Ratcliffe [:miker] [:mratcliffe] [:mikeratcliffe] from comment #2)

> @jimb I agree that we should avoid using empty catch blocks and totally understand your frustration but we have had so many different situations come up where this blows up that this seemed the safest thing to do.
> 
> This is a difficult one to solve because using an object as a listener is completely fine e.g.
> 
> ```js
> var obj = {
>   handleEvent(e) {
>     console.log(this === obj);
>   }
> };
> 
> document.body.addEventListener('click', obj);
> ```
> 
> I'll take a look... maybe we can do this better.
> 
> If I remember rightly, the melon that broke the monkey's back was when I discovered that some event listeners are not even JS but are somehow C++.
> 
> I will also add something to log a warning so we can at least see what went wrong.

Back to Bug 1519597 Comment 3