Open saschanaz opened 2 years ago
So per the spec
stack
is nonstandard and thus it should not be an accessor.
I'm not sure this follows?
The intent of the quoted part of the IDL: if you're adding nonstandard properties, such as stack
, to Error
, then also add them to DOMException
.
It doesn't say anything like: if you're adding nonstandard properties, such as stack
, to Error
, don't add them to DOMException
as accessors.
Oh oops, yes, I misread it, thanks for the correction.
But "add to the instance" still sounds like Object.hasOwn(domException, "stack")
should be true to me, doesn't it?
Edit: so many edits, I'll go bed, sorry 🥲
I see how it can be read that way, yeah. That wasn't really the intent; probably the word "instance" shouldn't have been used. The goal was basically "if Error has stack, then DOMException should too".
I was just watching the war (😉) at https://github.com/whatwg/webidl/pull/1179 and https://github.com/whatwg/webidl/pull/1179#issuecomment-1241307416 interested me. Gecko does have
Error.prototype.stack
as an IDL accessor while Blink/WebKit do not, and currently the spec says:So per the specshould it be in the standard? How many rabbits are in the hole?stack
is nonstandard and thus it should not be an accessor. But