Bug 174216
| Summary: | Update DOMException to the latest spec | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Domenic Denicola <d> |
| Component: | Bindings | Assignee: | Nobody <webkit-unassigned> |
| Status: | REOPENED | ||
| Severity: | Normal | CC: | annevk, cdumez |
| Priority: | P2 | ||
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 174702, 174597, 174603, 174630 | ||
| Bug Blocks: | |||
Domenic Denicola
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.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Anne van Kesteren
https://w3c-test.org/url/urlsearchparams-constructor.html also changed because of this.
Chris Dumez
Fixed in dependency bugs.
Domenic Denicola
Any interest in fixing the stack issue? I didn't see that in the dependency bugs.
Chris Dumez
(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?
Domenic Denicola
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
Chris Dumez
(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.
Chris Dumez
(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.