I can't figure out what you are proposing, but as you have figured out
Firebug does not use Firefox's functionName, it's pretty worthless.
Instead Firebug has a totally hacky heuristic solution to look around
in the source for a name. While I welcome suggestions, I am reluctant
to hack on the hack, since we don't know what we are doing. We don't
have test cases for a heuristic solution for example.
The entire enterprise is somewhat confusing. I finally concluded that
function names don't actually make any sense in javascript anyway.
Functions are properties of objects, that is what is important. It's
much more important to know "what properties of what objects point to
this function?". For example,
function handleOnload(event) {..}
window.addEventListener('load', handleOnLoad, true);
What is important here? The string "handleOnload" helps us navigate
from the addEventListener line to the function, but it has no
significance. We could write:
function bizantyneFix13(event) {..}
window.addEventListener('load', bizantyneFix13, true);
just as well, and
window.addEventListener('load', function(event){...}, true);
On the other hand, if you can tell me what function is in
window.onload property, now we're talking.
Nevertheless I am interested in any incremental suggestions about
function names.
jjb
On Jul 27, 3:19 pm, reddaly <[email protected]> wrote:
> Hi,
>
> Firebug does not detect the names of many of my functions as I wish
> they would. Many, many functions are labeled "anonymous." Could I
> assign a property to these lambda functions that will override the
> default provided by firefox? the relevant code to modify looks like
> it's in lib.js in the function getFunctionDescription: function
> (script, context, frame)
>
> maybe a modification like this would work, but it is untested:
>
> if (frame)
> {
> var fnc = script.functionObject.getWrappedValue();
> var name = (fnc && fnc.fbName) || frame.name;
> var args = FBL.getFunctionArgValues(fnc, frame);
> }
> else
> {
> var fnc = script.functionObject.getWrappedValue();
> var name = (fnc && fnc.fbName) || script.functionName;
> var args = [];
> }
>
> Best regards,
> Red Daly
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Firebug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/firebug?hl=en
-~----------~----~----~----~------~----~------~--~---