Y
Yan Huang
Hi,
I attempted to give all objects in a browser environment some special
property like __myOwnProp__, through the following code,
Object.prototype.__myOwnProp__ = 1;
This seems works fine with all native and user-defined objects,
String.__myOwnProp__; // 1
window.__myOwnProp__; // 1
window.document.__myOwnProp__; // 1
but not with dynamically created host objects supplied by the browser.
For example,
var w = window.open();
w.__myOwnProp__; // undefined
Anyone knows how to make this __myOwnProp__ property inheritable by a
dynamically created host objects like the w in the code above?
Thanks,
Yan Huang
I attempted to give all objects in a browser environment some special
property like __myOwnProp__, through the following code,
Object.prototype.__myOwnProp__ = 1;
This seems works fine with all native and user-defined objects,
String.__myOwnProp__; // 1
window.__myOwnProp__; // 1
window.document.__myOwnProp__; // 1
but not with dynamically created host objects supplied by the browser.
For example,
var w = window.open();
w.__myOwnProp__; // undefined
Anyone knows how to make this __myOwnProp__ property inheritable by a
dynamically created host objects like the w in the code above?
Thanks,
Yan Huang