W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2013

Re: Exceptions in event listeners triggered by dispatchEvent().

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 04 Jun 2013 13:47:32 -0400
Message-ID: <51AE2834.8050703@mit.edu>
To: www-dom@w3.org
On 6/4/13 11:19 AM, Domenic Denicola wrote:
>> Using the event loop system just to change the way an exception is handled doesn't make any sense to me.
> Really? To JavaScript programmers, it's the only thing that makes sense. There is no way in native JavaScript semantics to do the magic thing the web platform currently does, wherein (a) code is executed synchronously, but (b) exceptions thrown from that code bypass any surrounding `try`/`catch` blocks, and instead reach `window.onerror`.

Uh... Sure there is.  It's as simple as a function that catches the 
exception and then calls window.onerror, no?

Received on Tuesday, 4 June 2013 17:48:06 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:37:02 UTC