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

Bjoern Hoehrmann <[email protected]>
Newsgroups gmane.comp.web.dom.general
Message-ID <[email protected]>
* Boris Zbarsky wrote:
>On 6/4/13 11:19 AM, Domenic Denicola wrote:
>> 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?

That may end up having different behavior when it comes to stack traces
and debugger behavior.
-- 
Björn Höhrmann · mailto:[email protected] · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.