On Wed, Feb 4, 2009 at 8:59 AM, Malte Kraus <[email protected]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Godmar Back schrieb:
>> Would anybody happen to know how I can access/find out the calling XUL
>> window within a method defined in global component code? (I could pass
>> in 'window' into each method, but I'm hoping for a simpler way.)
> As long as the caller used wrappedJSObject, you can do this:
>
> function name() {
>  var win = name.caller.__parent__;
> }

Thank you!

Is it possible to walk the stack in some way in case the function is
called indirectly along a chain of calls, as in
'name.caller.caller....' until a __parent__ property is found?

Also, can name.caller be replaced with arguments.caller? (I find
conflicting information in MDC - it says that arguments.caller is no
longer supported for security reasons, though this wouldn't make sense
for XUL code.)

 - Godmar
_______________________________________________
Project_owners mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/project_owners

Reply via email to