getOwnPropertyDescriptor side effects

Francisco Tolmasky tolmasky at
Fri Jan 6 19:11:10 UTC 2017

Is there any position on whether getOwnPropertyDescriptor should not have
side-effects? I ask because some v8 getOwnPropertyDescriptor *do* have side
effects (for example, Object.getOwnPropertyDescriptor(new Error, “stack”)
will call Error.prepareStackTrace (it used to not)). Currently I
treat getOwnPropertyDescriptor as a “safe” way to observe an object —
(unlike say calling each member on an object which could set off getters).

Francisco Tolmasky
tolmasky at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list