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

On Wed, 05 Jun 2013 03:25:12 +0200, Glenn Maynard <glenn@zewt.org> wrote:

> Note that you wouldn't want to call window.onerror directly, since you  
> want
> "error" event listeners to be run, too.  You'd dispatch an ErrorEvent,  
> eg.
> window.dispatchEvent(new ErrorEvent("error", {"message": "message",
> filename: "filename", lineno: 100}));

No. window.onerror is invoked directly without an event. ErrorEvent is for  
the case when an uncaught error is fired on a Worker object (if the error  
wasn't handled in the worker itself).

-- 
Simon Pieters
Opera Software

Received on Wednesday, 5 June 2013 12:37:31 UTC