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 () {};
How can I detect that bar lies between foo and Object.prototype?
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`?
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 betweenfoo
andObject.prototype
?