Subj : Object caller references To : netscape.public.mozilla.jseng From : Neil Stansbury Date : Tue Aug 09 2005 08:19 pm Hi all, I have a number of objects that require a pointer to the object they were created by. This is basically so I can mark a property r/o without needing init() methods on the object eg: Rather than.. function myObj() { this.parent = null; this.init = function(val) { this.parent = val; }; } var obj = new myObj(); obj.init(this); // Now obj.parent == this Instead do... function myObj() { this.parent = myObj.caller; } var obj = new myObj1(); // Now obj.parent == this I have two questions: 1) Is this bad JS form - is there a better way? 2) Why does (obj.parent instanceof myObj) return false? Cheers, N .