getOwnPropertyDescriptor side effects

Boris Zbarsky bzbarsky at mit.edu
Tue Jan 10 20:38:50 UTC 2017


On 1/10/17 2:54 PM, Michał Wadas wrote:
> Internal slots correspond to internal state that is associated with
> objects and used by various ECMAScript specification algorithms.
> *Internal slots are not object properties* and they are not inherited.

OK, so having an internal slot for the value of .stack would be a spec 
violation too, yes?

> So it's spec violation to have custom [[GetOwnProperty]] implementation
> on ordinary objects.

Sure.  Ideally such things would be brought to the committee so the spec 
could be adjusted as needed for real-life (or implementations changed if 
real life does not actually require the exotic behavior).  That's what's 
happened in the past for things like the global object.

Really, .stack or equivalent just needs to be standardized; then this 
will all get sorted out.

-Boris


More information about the es-discuss mailing list