W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2013

Re: [whatwg] Stack trace in window.onerror

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 26 Jul 2013 21:52:18 +0000 (UTC)
To: James Greene <james.m.greene@gmail.com>
Message-ID: <alpine.DEB.2.00.1307262148070.27623@ps20323.dreamhostps.com>
Cc: whatwg <whatwg@whatwg.org>
On Fri, 26 Jul 2013, James Greene wrote:
> My last name ends with an 'e' ('Greene' vs. 'Green').  Please correct 
> that when you get a chance. Thanks!

Oops, my apologies. Fixed.

> You had mentioned earlier that there is already a window 'error' event 
> that can be listened to via `window.addEventListener('error', fn, 
> false);` if you don't use `window.onerror = fn;`:

Or indeed if you do. They both fire.

> Is that clarified in the spec somewhere already?

Yeah, this was a recent change.

> Although that makes perfect sense to me, I have never noticed it before 
> nor heard of any browser vendors implementing such.  Have there been any 
> such implementations yet?  If so, that's *wonderful* news.  :)

Some quick testing shows this working in at least Firefox and Chrome. That 
is, the 'error' event fires. In Chrome it has attributes "message", 
"lineno", and "filename", but it doesn't seem to in Firefox.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Friday, 26 July 2013 21:52:42 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:03 UTC