How can I figure out which function is being referenced in javascript?
<p>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:</p>

<pre><code>        if (console &amp;&amp; console.log &amp;&amp; method.toSource) {
            console.log(method.toSource());
        }
</code></pre>

<p>This only works in FF but at least then I can search for the source of the called function. Is there a better way?</p>
