Subj : Re: JavaScript problem To : Adrian Herscu From : Brendan Eich Date : Sun Oct 12 2003 11:34 am Adrian Herscu wrote: > I want o.f() to execute in caller's context and without passing the > "this" reference as a parameter. > > A simplified version: > > function f() { > alert( f.caller.p ); > } > > > function g() { > f(); // executes in the default context - work > f.call(this); // executes in a forced context - doesn't work f.caller in the second case will be Function.prototype.call -- the native call method. It has no p property, of course. If you want to work in Mozilla and IE, you could either code both ways and test user agent to decide which tine of the code fork to follow, or you could loop over caller until you find p (and not more than twice). /be > } > g.p = "hello"; > > g(); > > > > > .