isPrototypeOf considered useless
P T Withington
ptw at pobox.com
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
true
js> Object.prototype.isPrototypeOf(foo)
true
js> foo.__proto_ === Object.prototype
false
How can I detect that `bar` lies between `foo` and `Object.prototype`?
More information about the Es4-discuss
mailing list