isPrototypeOf considered useless

P T Withington ptw at
Sun Sep 30 13:30:29 PDT 2007

If the prototype property of an object is not going to be exposed, is  
there going to be a way that I can tell whether or not there are  
intervening prototypes?

js> function objectWithPrototype (proto) { function xtor () {};  
xtor.prototype = proto; return new xtor; }
js> bar = { b: 2 }
[object Object]
js> foo = objectWithPrototype(bar)
[object Object]
js> foo instanceof Object
js> Object.prototype.isPrototypeOf(foo)
js> foo.__proto_ === Object.prototype

How can I detect that `bar` lies between `foo` and `Object.prototype`?

More information about the Es4-discuss mailing list