I know Object.defineProperty is lots of fun and a great replacement for __defineGetter__ and __defineSetter__ nonstandard APIs, but is there a similar counterpart for __lookupGetter__? Or some way of achieving a similar thing?
I know Object.defineProperty is lots of fun and a great replacement for __defineGetter__ and
Share
I’m not sure of the
__lookupGetter__semantics but ES5 provides a new APIObject.getOwnPropertyDescriptorthat gives you a descriptor object containing the attributes of a property and either itsvalueor itsgetand/orsetfunctions.eg.
Will give you the getter function