11

On a Mac, Firebug outputs proper function names in profiler mode. On a PC, allmost all functions are logged as 'anonymous'. In this instance, almost all the function calls are prototype methods. Is there a way to get at the function names on the PC version? A setting?

Here's the difference. You can see why the PC version is far inferior. This is profiling the exact same code! (Running FF 9, Latest stable Firebug) enter image description here

FlavorScape
  • 13,301
  • 12
  • 75
  • 117
  • Have you tried updating your Firefox & Firebug? I remember seeing Firebug's release notes on a recent release related to this. – blong Jan 24 '12 at 03:47
  • Fresh install yesterday (2012.01.23)of latest stable build. – FlavorScape Jan 24 '12 at 19:16
  • I've notified the folks over at firebug. Strangely, anonymous functions like foo.prototype.bar = function(){} will resolve correctly to the prototype name on a mac, whereas on PC is resolves to anonymous. – FlavorScape Mar 06 '12 at 02:03
  • On my Windows XP machine, surprisingly, IE8 seems to have the best support for displaying anonymous functions in profiler (dont't read it as 'IE has best profiler'; whole IE dev tools are painfully slow). They have some heuristics for doing it, as they described [in this blog post](http://blogs.msdn.com/b/ie/archive/2008/09/11/introducing-the-ie8-developer-tools-jscript-profiler.aspx). In Firefox/Firebug, Chrome, Safari unnamed anonymous functions are displayed without the name unfortunately. – jakub.g Mar 16 '12 at 16:11

2 Answers2

2

If nothing else works, you can always name the function:

var functionVariable = function nameVisibleToDebugger(parameters) {
 ...
}
Michael Lorton
  • 43,060
  • 26
  • 103
  • 144
  • If you were correct, it would be in global scope; since you are incorrect, it might be, and is, in function scope. – Michael Lorton Sep 12 '13 at 17:24
  • That's why I added "if I'm correct" - I was applying my expectation to Javascript, which - after 4 weeks of JS - turns out to be faulty... – virtualnobi Sep 13 '13 at 06:58
0

I don't know, but I'd suggest posting to Firebug's user group: http://groups.google.com/group/firebug . Good luck!

blong
  • 2,815
  • 8
  • 44
  • 110
  • 1
    Here's the thread if you want to watch it: http://groups.google.com/group/firebug/browse_thread/thread/3607c112a826eb29/4e3ff33612e8ca7c?pli=1 – jakub.g Mar 16 '12 at 16:07