For years the spec for DOMException has not matched what was implemented. We recently fixed this by converging on the majority behavior, in https://github.com/heycam/webidl/pull/378. Failing-in-Safari tests are available at: - http://w3c-test.org/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor-behavior.any.html - http://w3c-test.org/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor-behavior.any.html - http://w3c-test.org/WebIDL/ecmascript-binding/es-exceptions/exceptions.html The spec is at: - https://heycam.github.io/webidl/#idl-DOMException - https://heycam.github.io/webidl/#idl-DOMException The following changes appear to be necessary to conform to the current spec: - Use getters on the prototype instead of own data properties for message/code/name. - Removing the toString() method and letting the default Error.prototype.toString() show through. - ("should", not "must") capturing stack traces for DOMExceptions, like for other Error classes.
https://w3c-test.org/url/urlsearchparams-constructor.html also changed because of this.
Fixed in dependency bugs.
Any interest in fixing the stack issue? I didn't see that in the dependency bugs.
(In reply to Domenic Denicola from comment #3) > Any interest in fixing the stack issue? I didn't see that in the dependency > bugs. What stack issue? Is this covered by a web platform test?
The > - ("should", not "must") capturing stack traces for DOMExceptions, like for other Error classes. And yeah, it's the last test in http://w3c-test.org/WebIDL/ecmascript-binding/es-exceptions/DOMException-custom-bindings.any.html
(In reply to Domenic Denicola from comment #5) > The > > > - ("should", not "must") capturing stack traces for DOMExceptions, like for other Error classes. > > And yeah, it's the last test in > http://w3c-test.org/WebIDL/ecmascript-binding/es-exceptions/DOMException- > custom-bindings.any.html Oh, I see. This does not sound super useful to me and is annoying to implement. I think I'll leave as is for now.
(In reply to Chris Dumez from comment #6) > (In reply to Domenic Denicola from comment #5) > > The > > > > > - ("should", not "must") capturing stack traces for DOMExceptions, like for other Error classes. > > > > And yeah, it's the last test in > > http://w3c-test.org/WebIDL/ecmascript-binding/es-exceptions/DOMException- > > custom-bindings.any.html > > Oh, I see. This does not sound super useful to me and is annoying to > implement. I think I'll leave as is for now. But I filed https://bugs.webkit.org/show_bug.cgi?id=174702.