Bug 174216 - Update DOMException to the latest spec
Summary: Update DOMException to the latest spec
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 174702 174597 174603 174630
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-06 14:12 PDT by Domenic Denicola
Modified: 2017-07-20 19:10 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Domenic Denicola 2017-07-06 14:12:22 PDT
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.
Comment 1 Anne van Kesteren 2017-07-14 06:26:10 PDT
https://w3c-test.org/url/urlsearchparams-constructor.html also changed because of this.
Comment 2 Chris Dumez 2017-07-20 16:44:45 PDT
Fixed in dependency bugs.
Comment 3 Domenic Denicola 2017-07-20 16:47:01 PDT
Any interest in fixing the stack issue? I didn't see that in the dependency bugs.
Comment 4 Chris Dumez 2017-07-20 16:54:31 PDT
(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?
Comment 5 Domenic Denicola 2017-07-20 17:02:14 PDT
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
Comment 6 Chris Dumez 2017-07-20 19:08:15 PDT
(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.
Comment 7 Chris Dumez 2017-07-20 19:10:43 PDT
(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.