Closed ljharb closed 1 week ago
(see #6)
The main place that needs changes is https://webidl.spec.whatwg.org/#js-exceptions, not HTML.
There might be some implications for HTML's StructuredSerializeInternal and friends as they currently branch on [[ErrorData]]. Perhaps that would allow us to redo https://github.com/whatwg/webidl/pull/732 in some way whereby Web IDL no longer relies on HTML for that? Unclear.
I do kinda like 1 as it brings Error and DOMException even closer together.
cc @domenic
1 seems nicer to me, assuming implementations are willing to deal with the compat implications. Which seem like they should be minuscule, but, you never know.
I definitely agree that 1 seems nicer if we can swing it.
I’ll attempt a PR for that approach, and we can discuss further from there.
Filed https://github.com/whatwg/webidl/pull/1421 as a starting point. I expect it'll need a lot of suggestions, so please review it!
The PR has been "directionally" approved, with only editorial changes needed, so I'm going to close this.
A PR will be needed, ideally before stage 2.7 (although this would otherwise be a concern to be addressed within 2.7) to ensure that DOM exceptions are considered to be Errors.
Some potential implementation strategies: