Object.prototype.get & bye bye Object.defineProperty

Brendan Eich brendan at mozilla.org
Thu Nov 29 11:16:04 PST 2012


Andrea Giammarchi wrote:
> I really don't understand what is exactly the advantage of considering 
> inherited properties for descriptors.

It's easy to overreact here. Don't mess with Object.prototype still 
applies, or you will have other WTF moments.

ES5 shipped this and browsers shipped implementations. David and others 
use it. I don't think we can change it.

The ES5 meta-object APIs are pretty much power-tools, with obvious 
verbosity and usability taxes. Better (more concise and usable) veneer 
on top has been done and should bubble up on github. This is not to 
excuse anything, but any process (standardized de-jure or not) that 
releases platform iterations to millions of developers will face this 
pain. Node.js is facing it now.

So I say doc this, evangelize it, and build better APIs on top of ES5. 
TC39 people are tracking.

/be


More information about the es-discuss mailing list