Closed Bug 624599 Opened 14 years ago Closed 9 years ago

jsdIframe.callee not a function (a Call instead)

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: sroussey, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.628.0 Safari/534.16 Build Identifier: So I was looking at implementing: http://code.google.com/p/fbug/issues/detail?id=1811 Given a sample file: <html> <script type="text/javascript"> test = function(){ debugger; } test.displayName = "a whole new test function name"; test(); </script> <body></body> </html> And here is an override for Firebug: FBL.StackFrame.prototype.getFunctionName = function(){ var fn = this.script.functionObject.getWrappedValue(); this.fn = fn.displayName || this.fn; return this.fn; }; The problem is that fn does not have displayName, so it can not be displayed in the stack trace. It is getting the anon function expression rather then the function object attached to the var test. See discussion here: https://groups.google.com/d/topic/mozilla.dev.platform/kwbtsvWmp3k/discussion Boris suggest that the script.callee should be used, but it is set incorrectly (is is a "Call", not a js function). If that were fixed then we could have this code work: FBL.StackFrame.prototype.getFunctionName = function(){ var fn = this.nativeFrame.callee.getWrappedValue(); this.fn = fn.displayName || this.fn; return this.fn; }; Workaround for now: FBL.StackFrame.prototype.getFunctionName = function(){ var fn = this.nativeFrame.scope.getWrappedValue().arguments.callee; this.fn = fn.displayName || this.fn; return this.fn; }; But worried about arguments.callee being deprecated. Using Fx 3.6. Reproducible: Always
Summary: jsdIframe.callee not a function → jsdIframe.callee not a function (a Call instead)
OS: Windows 7 → Windows XP
Component: JavaScript Debugging/Profiling APIs → JavaScript Engine
JSD was removed.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.