PC version profiler shows all functions as anonymous

309 views
Skip to first unread message

flavorscape

unread,
Jan 26, 2012, 6:37:43 PM1/26/12
to Firebug
Hi!

When I run the profiler on a PC, all the function names are
'anonymous' , but if I run it on a mac, I get proper function names.
The functions in question are all prototypes. I have the latest stable
builds installed as of 2012/01/26


For the image, see the post I started here:

http://stackoverflow.com/questions/8978787/how-to-get-firebug-profiler-to-show-functions-as-non-anonymous


thanks for everything!

Jan Honza Odvarko

unread,
Jan 27, 2012, 9:14:44 AM1/27/12
to fir...@googlegroups.com
What version of Firebug are you using?
(please provide the number)

Could we try the page you are profiling?
(or another simple page that shows the problem)

Honza

Vance Feldman

unread,
Jan 27, 2012, 5:03:44 PM1/27/12
to fir...@googlegroups.com
This is version 1.9.0 PC. FF 10 Beta.~maybe that's the reason?

The files i'm working on are under NDA, but it seems like anything that is a prototype function does not show.





--
You received this message because you are subscribed to the Google
Groups "Firebug" group.
To post to this group, send email to fir...@googlegroups.com
To unsubscribe from this group, send email to
firebug+u...@googlegroups.com
For more options, visit this group at
https://groups.google.com/forum/#!forum/firebug



--

Art: ForeverScape.com | 503 317 0685                              


Jan Honza Odvarko

unread,
Jan 30, 2012, 1:31:30 PM1/30/12
to fir...@googlegroups.com, va...@foreverscape.com
On Friday, January 27, 2012 11:03:44 PM UTC+1, flavorscape wrote:
This is version 1.9.0 PC. FF 10 Beta.~maybe that's the reason?

The files i'm working on are under NDA, but it seems like anything that is a prototype function does not show.
Are you sure the function actually has a name?

See my example:

<button onclick="executeTest()">Click Me!</button>

<script type="text/javascript">
function test()
{
}

test.prototype =
{
    a: function a()
    {
        this.b();
    },
   
    b: function()
    {
       
    },
}

function executeTest()
{
    var t = new test();
    t.a();
}
</script>

After profiling a button click, the only anonymous function is |test.b|

Honza

vance feldman

unread,
Jan 30, 2012, 1:35:10 PM1/30/12
to fir...@googlegroups.com
Yep (well they show up on the mac).

some example functions:

 Vecmath.Vec3.prototype.set1=function(v) {
    this.x=v.x;this.y=v.y;this.z=v.z;
  }
  Vecmath.Vec3.prototype.sub1=function(v) {
    this.x-=v.x;this.y-=v.y;this.z-=v.z;
  }
  Vecmath.Vec3.prototype.sub2=function(t1,t2) {
    this.x = t1.x - t2.x;
    this.    y = t1.y - t2.y;
    this.    z = t1.z - t2.z;
  }
  Vecmath.Vec3.prototype.cross=function(v1,v2) {
    this.set3(
      v1.y*v2.z - v1.z*v2.y,
      v1.z*v2.x - v1.x*v2.z,
      v1.x*v2.y - v1.y*v2.x
    );
  }


--
VANCE FELDMAN
ForeverScape

Jan Honza Odvarko

unread,
Jan 30, 2012, 1:48:30 PM1/30/12
to fir...@googlegroups.com
On Monday, January 30, 2012 7:35:10 PM UTC+1, vance feldman wrote:
Yep (well they show up on the mac).
Ah, true you mentioned that, it's weird.

some example functions:

 Vecmath.Vec3.prototype.set1=function(v) {
    this.x=v.x;this.y=v.y;this.z=v.z;
  }
So, yes this is an anonymous function.

Following function has a name "my_set1"
Vecmath.Vec3.prototype.set1 = function my_set1(v)
{

    this.x=v.x;this.y=v.y;this.z=v.z;
}

Try to change that and profile again.

If you provide simple and working page I can test on Windows and Mac

Honza


Vance Feldman

unread,
Jan 30, 2012, 2:21:26 PM1/30/12
to fir...@googlegroups.com
Whew. Thanks for looking into this.. I have less than a week to port a c++ physics engine into js, so no time =(

At any rate I can continue to profile on the mac for now.

--
You received this message because you are subscribed to the Google
Groups "Firebug" group.
To post to this group, send email to fir...@googlegroups.com
To unsubscribe from this group, send email to
firebug+u...@googlegroups.com
For more options, visit this group at
https://groups.google.com/forum/#!forum/firebug

ed

unread,
Feb 28, 2012, 3:05:27 PM2/28/12
to Firebug
If you create a function in an object like this:
var o = { f: function() {} };
then the debugger will show the function name, but the profiler does
not.
However
var o = { f: function f(){} };
shows the function name in the profiler as well. That the debugger
knows the function's name hints to me that firefox know the function
name.
Here is a page that demonstrates the problem. Just load, start
profiling and click the button.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>a test page</title>
<script>
var o = {
foo: function()
{
console.log("from foo");
this.bar();
},
bar: function bar() {
console.log("from bar");
}
};
function test()
{
o.foo();
}
</script>
</head>
<body class=" claro " >
<button onclick="test()">test</button>

</body>
</html>
Reply all
Reply to author
Forward
0 new messages