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

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

From: Simon Pieters <simonp@opera.com>
Date: Wed, 05 Jun 2013 14:37:41 +0200
To: "Domenic Denicola" <domenic@domenicdenicola.com>, "Glenn Maynard" <glenn@zewt.org>
Cc: "John Barton" <johnjbarton@google.com>, johnjbarton <johnjbarton@chromium.org>, "www-dom@w3.org" <www-dom@w3.org>, "Anne van Kesteren" <annevk@annevk.nl>
Message-ID: <op.wx7hc3zuidj3kv@simons-macbook-pro.local>
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

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