Subj : Re: Method added into Object.prototype: can't call directly inside XUL context. To : netscape.public.mozilla.jseng From : Lev Serebryakov Date : Mon Oct 03 2005 01:05 pm > What is XXX, exactly? I bet you are not using the same XXX in the js > shell, because XXX is a DOM or XPCOM object of some kind. This was cut'n'pasted! It is minimal example of error. I found this strange behavior when XXX was really big-and-scare object, but it is completely MY object. Not a XPCOM object, nor DOM one. I'm constructing some code, which implements inheritance by copying functions, getters and setters from prototype of base to prototype of child. It makes more work, adds supports for `object.SUPER.method()' and some other tricks. It does it work in `Constructor.inherits( BaseConstructor );' call, and 'inherits' is added to Object's prototype. This code works well in JS Environment, but not in XUL window's scripts :( I've start to experitment after this error and found minmal example to demonstrate this behaviour. Posted code with `XXX' is this minimal example, and it was cut'n'pasted from my code, where it works (in Env/Shell) and doesn't work (in XUL). But, I repeat, I call this code for custom objects, I don't try to apply it to any XPOCM or DOM object. And even all my `inheritance' code works well if I call `inherits' method through `prototype.inherits.apply'. May be, it is because `function XXX()' becomes property of `window' object when it is encountered in script, loaded into XUL? -- // Lev Serebryakov .