I'm working on some JS where functions are passed around by reference, and it's difficult to see which function is being called at times. It will be passed around through 7-8 functions each with a ton of parameters, so it's very time consuming to track back where it came from. I'm working on changing a bit of this, but the only way I've been able to figure out to see which function is actually being called it is to do something like this:
if (console && console.log && method.toSource) {
console.log(method.toSource());
}
This only works in FF but at least then I can search for the source of the called function. Is there a better way?