8.12.2 GetProperty

2010-04-19

PropertyDescriptor [[GetProperty]](P:String)

Same as [[GetOwnProperty]] (retrieve the PD for a specific property) except it also takes inherited childeren through prototype into account. Returns the first found property in the prototypal chain.

Code: (Abstract Ecma)
function GetProperty(P){
var prop = O.[[GetOwnProperty]](P);
if (prop !== undefined) return prop;
var proto = O.[[Prototype]];
if (proto === null) return undefined;
return proto.[[GetProperty]](P);
}