Hi,

I am debugging for quite a time now, and finally could identify the point where
building the stacktrace (e.g. calling this.printStackTrace()) fails with quite a
critical error "Permission denied to get property Function.caller" in Firefox
with Firebug.

The (simplified) scenario is as follows. I have an instance of a qooxdoo object,
this one uses an XMLHttpRequest for AJAX. It registers a callback method though
a dispatcher function so that the 'this' reference inside the callback points to
the qooxdoo object. Inside callback, this.printStackTrace() is invoked - and 
fails!

I used Firebird to step through the building of the stack trace. In
"getStackTraceFromCaller" (StackTrace.js:135) the stack is build in a while loop
(lines 148-165). With "fcn = fcn.caller;" (153) each caller is retrieved.
However, at a step the internal event handler of Firebug for the XmlHttpRequest,
named "handleEvent", is reached. Trying to access the "caller" property of this
handler causes the permission exception.

Paste the following lines into your Firebug console:

var req = new XMLHttpRequest();
req.onreadystatechange = function() {
  if (req.readyState == 4) {
    qx.dev.StackTrace.getStackTrace();
  }
};
req.open('GET', '/', true);
req.send(null);

A try-catch around the .caller access breaking the loop fixes it.

Fabio



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to