`DOMException` should have `[[ErrorData]]` internal slot
Version
N/A
Platform
N/A
Subsystem
N/A
What steps will reproduce the bug?
This bug has not surfaced yet, but when V8 implements Error.isError, it should return true for DOMException.
Error.isError(new DOMException(1)) // => false, true expected
How often does it reproduce? Is there a required condition?
Not yet.
What is the expected behavior? Why is that the expected behavior?
Due to a change in Web IDL. https://github.com/whatwg/webidl/pull/1421
What do you see instead?
Not yet.
Additional information
This issue can be resolved by using Reflect.construct.
https://github.com/denoland/deno/pull/27342
As a side effect, util.types.isNativeError will return true as well.
A simple way to do this might be making https://github.com/nodejs/node/blob/062ae6f3cb52bc741e47bb54a292dc0325da6083/lib/internal/per_context/domexception.js#L51 extend Error.
A simple way to do this might be making
node/lib/internal/per_context/domexception.js
extend Error.
I tried to implement inheriting Error in Deno, but it caused WPT fails.
Object.getPrototypeOf(DOMException) === Function.prototype; // true
https://github.com/web-platform-tests/wpt/blob/5799f5b24761cff805f20e5ec130bf3cb328e4ed/webidl/ecmascript-binding/es-exceptions/DOMException-custom-bindings.any.js#L13-L15
@petamoriken indeed you'd have to Object.setPrototypeOf(DOMException.prototype, Function.prototype) or something as well.
V8 is updated to 13.6 with shipped Error.isError, this issue is not fixed, stable Node 24 is planned in some days.
Related to https://github.com/nodejs/node/issues/40789