This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 24000 - DOMException should extend ES Error
Summary: DOMException should extend ES Error
Status: RESOLVED DUPLICATE of bug 23367
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: PC Windows 3.1
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-05 08:33 UTC by Marcos Caceres
Modified: 2013-12-09 14:26 UTC (History)
4 users (show)

See Also:


Attachments

Description Marcos Caceres 2013-12-05 08:33:20 UTC
To make DOMException Promises friendly, the DOMException IDL definition needs to extend ES Error. See:
https://github.com/domenic/promises-unwrapping/issues/84

Testing the following:

<script>
try {
    document.body.appendChild(document.body)
} catch (e) {
    alert(e instanceof Error)
}
</script>

The latest versions of Chrome, Safari, and IE return true. FF returns false.
Comment 1 Ms2ger 2013-12-08 08:31:57 UTC
I think http://heycam.github.io/webidl/#es-exceptions already requires that.
Comment 2 Marcos Caceres 2013-12-08 13:36:58 UTC
(In reply to Ms2ger from comment #1)
> I think http://heycam.github.io/webidl/#es-exceptions already requires that.

Why not just make it explicit? It seems we missed this in Gecko ... could it be possible that happened because DOMException does not specify it explicitly?
Comment 3 Ms2ger 2013-12-08 14:19:10 UTC
No, that happened because there was no real spec for this when we implemented DOMException as an interface in 2001.
Comment 4 Marcos Caceres 2013-12-09 00:15:45 UTC
I'm still not happy that the DOM Spec does not clarify this (or just make it explicit). It should at least contain a note.
Comment 5 Anne 2013-12-09 14:26:45 UTC
It is explicit by not using "interface" but "exception". However, it sounds like what you want is a duplicate of a bug I filed a while ago.

*** This bug has been marked as a duplicate of bug 23367 ***