getOwnPropertyDescriptor side effects

Jordan Harband ljharb at gmail.com
Fri Jan 20 19:26:13 UTC 2017


If you have feedback on the proposal, please file issues on the repo
instead of replying in the thread.

Also note that for changing existing behavior to be "web incompatible", all
the browsers have to *agree* on it - in other words, if you're currently
relying on behavior that only works in some browsers (as opposed to all),
then it's totally fine for your code to be broken by a spec change.

On Thu, Jan 19, 2017 at 10:57 AM, Mark Miller <erights at gmail.com> wrote:

>
>
> On Thu, Jan 19, 2017 at 10:52 AM, Mark S. Miller <erights at google.com>
> wrote:
>
>>
>>
>> On Thu, Jan 19, 2017 at 9:30 AM, 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.
>>
>>
>> That makes perfect sense.
>>
>> We could have the Error.prototype.getter
>>
>
> I meant: the Error.prototype.stack getter
>
>
>
>> not throw but have System.getStack throw. There was no strong reason for
>> the getter and System.getStack to have precisely the same behavior; it was
>> just that there was no reason not to. Now there is. Thanks.
>>
>>
>>
>>
>>>
>>>
>>> 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
>>> _______________________________________________
>>> es-discuss mailing list
>>> es-discuss at mozilla.org
>>> https://mail.mozilla.org/listinfo/es-discuss
>>>
>>
>>
>>
>> --
>>     Cheers,
>>     --MarkM
>>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>>
>
>
> --
>   Cheers,
>   --MarkM
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170120/d40e77eb/attachment-0001.html>


More information about the es-discuss mailing list