Re: Exceptions in event listeners triggered by dispatchEvent().
Glenn Maynard <[email protected]>
| Newsgroups | gmane.comp.web.dom.general |
|---|---|
| Message-ID | <CABirCh-TkdO=XEk+ho7OrUrNW5A8kiEt1q72xNmQxgr+W7Mc0Q@mail.gmail.com> |
On Fri, Jun 7, 2013 at 8:09 AM, Simon Pieters <[email protected]> wrote: > Well then those browsers violate the spec and the original > implementation... At least Presto implements the spec. When IE, Chrome and Firefox all violate the spec in the same way, it's the spec that's wrong. You know that. > (The spec looks incorrect here. It bypasses event dispatch entirely and >> calls "onerror" directly, which forgets to fire event listeners. It also >> doesn't make much sense to support error handling with event listeners in >> workers but not in the UI thread. This should probably just fire an >> ErrorEvent, and the window.onerror special case should probably be in the >> event dispatch algorithm.) >> > > You misunderstood the worker case. Errors in workers are handled the same > as in window, i.e. onerror is invoked directly. However, if a worker error > is not "handled", an ErrorEvent gets fired on the Worker object. Sorry, I don't follow and I don't believe I'm misunderstanding anything. The above describes the *non*-worker behavior. http://www.whatwg.org/specs/web-apps/current-work/#report-the-error -- Glenn Maynard