You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In current implementation, all this really means is to make DOMException inherit from JS::Error. Though we will need to do a bit of rejigging to avoid diamond inheritance problem in this case
This is a bit tricky because according to WPT, DOMException.prototype should inherit from Error.prototype, but DOMException should not inherit from Error.
Sure, that's fine - C++ inheritance of DOMException doesn't impact the javascript prototype chain (mostly). We can make DOMException inherit from JS::Error as an implementation detail of the [[ErrorData]] slot, and set up the prototype / cosntructor on javascript exposed level as needed. The main big issue with that is that DOMException would be inheriting JS::Object from both PlatformObject and JS::Error. So there is some rejigging we need to do to make it work (or choose a different method of representing that data slot)
The main impact of the [[ErrorData]] slot is just to make this type of check work:
whatwg/webidl#1421
Sounds simple, but the spec steps are currently implemented in the IDL generator so that may or may not be fun ™️.
The text was updated successfully, but these errors were encountered: