Hi, Since CallFrame::callee() returns a JSFunction, callee() always returns 0 for host functions. This means that if you want to know the callee at some later point (e.g. walking up the stack), you'd have to store the callee argument that the host function received, and maintain some mapping from the callFrame to callee. And that only works if you implemented the host function yourself. It would be nice if CallFrame::callee() always gave you the callee, regardless of whether it's a host call or JS call; i.e. change the type of callee() to be InternalFunction. Is there anything that prohibits such a change? (If not, I can try to work out a patch.) Regards, Kent
callee() is used to provide the arguments.callee property inside JS, which is defined as returning null for a native function It would be nice if we could provide a complete call stack in console.trace, i believe currently that also fails a native function boundaries, so i assume it is using the callee() function. I believe it should possible to provide a full trace already after all the debugger can do it so we must have appropriate infrasttructre lying around :D That said CallFrame::callee() should not be used directly as it is deeply internal data --Oliver On Jan 7, 2009, at 2:41 AM, Kent Hansen wrote:
Hi, Since CallFrame::callee() returns a JSFunction, callee() always returns 0 for host functions. This means that if you want to know the callee at some later point (e.g. walking up the stack), you'd have to store the callee argument that the host function received, and maintain some mapping from the callFrame to callee. And that only works if you implemented the host function yourself. It would be nice if CallFrame::callee() always gave you the callee, regardless of whether it's a host call or JS call; i.e. change the type of callee() to be InternalFunction. Is there anything that prohibits such a change? (If not, I can try to work out a patch.)
Regards, Kent _______________________________________________ squirrelfish-dev mailing list squirrelfish-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/squirrelfish-dev
participants (2)
-
Kent Hansen
-
Oliver Hunt