I'm not sure about the semantics of __lookupGetter__
, but ES5 provides a new API Object.getOwnPropertyDescriptor
that gives you a descriptor object containing property attributes and either its value
or its get
and / or set
.
eg.
Object.getOwnPropertyDescriptor("foo", {get foo() { return 5} }).get
Gives you a getter function
source share