Object.prototype.get & bye bye Object.defineProperty

Brandon Benvie brandon at brandonbenvie.com
Wed Nov 28 21:20:10 PST 2012


To answer that question, I do. I reuse descriptors often for performance
but also use prototypal inheritance as well.Since most descriptors share
the same common properties for all but one (or two) fields, they are an
ideal candidate for use with prototypal inheritance.

The answer though in that case is easy enough though, make sure the
prototype descriptor is created with Object.create(null). This wouldn't
solve compatibility issues with in-the-wild code but it solves the issue
for most people who care enough to use anything dealing with descriptors.


Who knows whether anybody does things like this
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121129/d19b852e/attachment.html>


More information about the es-discuss mailing list