Should Error.isError return true for WebAssembly.Exception objects?
Ref https://github.com/tc39/proposal-is-error/issues/20
Yes, it should.
WebAssembly.Exception objects intentionally don't inherit from Error (https://github.com/WebAssembly/exception-handling/issues/183). I'm not familiar with the isError proposal, but from skimming it, that seems like it should mean that we should return false for WebAssembly.Exception objects.
It doesn’t have to inherit from Error to return true, but if the reasoning is so they don’t have stack traces, and assuming they don’t have special structuredClone serialization behavior, then the predicate should probably return false for them, yes.
Yes, the main reason is to avoid requiring stack traces (although they can have them if the JS constructor is used with a flag [1]). They also are not structured cloneable.
[1] https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/Exceptions.md#api-additions
It sounds like the consensus then is for Error.isError to return false for WA.Exception. It also sounds like that's the default behavior unless we added an [[ErrorData]] slot. So I think this should be closed (I don't have permissions).