Contact emails
Spec
http://heycam.github.io/webidl/#es-DOMException-constructor-object
Note that DOMException used to be defined in the DOM specs, but has migrated out of WHATWG's DOM spec to WebIDL as a fundamental part of the platform.
Summary
var ex = new DOMException(message, opt_name);
Motivation
The primary use case is self-hosting/polyfilling APIs that are specified to throw DOMExceptions. Polyfills use various hacks such as tickling other APIs to get exceptions, or throwing plain Errors or "subclasses" that look like DOMExceptions.
This applies both to synchronous APIs that throw and asynchronous Promise-based APIs, where the TAG recommends that rejections are DOMExceptions: http://www.w3.org/2001/tag/doc/promises-guide#reasons-should-be-errors
Compatibility Risk
Implemented in Gecko/Firefox (in stable builds).
Ongoing technical constraints
None at the moment.
The spec allows for construction without the 'new' operator (like native JS Error objects), which would require bindings changes, but Gecko doesn't support that yet either. The fine details of the spec around properties, prototypes, and so forth aren't matched yet either - DOMException is now defined more like the native JS Error types than other DOM interfaces. We can tackle that over time.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes.
OWP launch tracking bug?
N/A (really minor - is this worth calling out?)
Link to entry on the feature dashboard
Not added yet, will create one if we go forward with this.
Requesting approval to ship?
Yes - the compat risk is low and we're unlikely to learn anything by leaving this "experimental"
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
-Boris