getOwnPropertyDescriptor side effects
isiahmeadows at gmail.com
Wed Jan 11 20:12:15 UTC 2017
Okay. The error stack being constructed that early is odd, though.
On Wed, Jan 11, 2017, 10:39 Boris Zbarsky <bzbarsky at mit.edu> wrote:
> On 1/11/17 6:43 AM, Isiah Meadows wrote:
> > Not if it's (likely) throwing from the `new Error`.
> It's not. The "stack" property in V8 quacks like a value property for
> the most part, but the first access to it invokes some code that does
> the (lazy) stack string construction. That process involves calling
> Error.prepareStackTrace if such a thing exists.
> Specifically, as of today, see
> which is called from
> The whole setup is basically designed to have things that look like data
> properties but actually involve executing code to compute the property
> value (and possibly executing code when the "value" property is set).
> SpiderMonkey has similar things as well, though we've been getting rid
> of them as much as possible. The obvious one that remains is .length on
> Array objects. This allows Array objects to be non-exotic for practical
> purposes in terms of their engine representation, and hence not suffer
> the performance penalties exotic objects suffer. In spec terms, of
> course, Array instances are just exotic objects. In an ideal world, the
> implementation detail is just that and is not observable....
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss