boolean Object.prototype.isPrototypeOf(V:object|mixed)
Returns true if O.[[Prototype]] == V.
Object.prototype.isPrototypeOf = function(V){
if (!IsObject(V)) return false; // todo: define IsObject?
var O = ToObject(this);
while (true) {
var V = V.[[Prototype]];
if (V === null) return false;
if (O === V) return true;
}
}
Note that V is checked to be an object first to preserve behaviour of older specifications, in case this is undefined or null (then ToObject throws an error).