getOwnPropertyDescriptor side effects

Isiah Meadows isiahmeadows at gmail.com
Thu Jan 19 17:38:12 UTC 2017


Thanks! I see now.

On Thu, Jan 19, 2017, 12:30 Boris Zbarsky <bzbarsky at mit.edu> wrote:

> On 1/19/17 12:24 PM, Isiah Meadows wrote:
> > 1. What does Firefox do with the getter on non-errors?
>
> Oh, I didn't make that clear, did I?  On a non-error in the getter, we
> have an Error object or Error.prototype (which appeared somewhere on our
> receiver's proto chain).  Those objects all have, in Spidermonkey, an
> internal slot that stores information about the stack.  The getter uses
> the information in that internal slot to create a string and return it.
>
> > 2. How breaking is having the getter and setter throwing on non-errors?
>
> Well, when we tried to do it it didn't even pass our test automation, so...
>
> In particular it would throw on anyone doing ES5-style subclassing of
> Error and then doing anything with .stack.
>
> > I'm struggling to see how it'd be that breaking. It's a getter, not a
> > method, so it requires a call to `__locateGetter__` or
> > `Object.defineProperty` to even access.
>
> No, it just requires that you have an Error on your prototype chain but
> not be an Error yourself, and suddenly you have exceptions everywhere.
>
> -Boris
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170119/ac5d8f33/attachment.html>


More information about the es-discuss mailing list