title: javascript - arguments.callee.toString() and arguments.callee.name does not return function name
body: <p>I'm trying to get the name of the currently running function. From what I've read, this should be possible using:</p>
  
  <pre><code>(arguments.callee.toString()).match(/function\s+(\[^\s\(]+)/)
  </code></pre>
  
  <p>However, when I run this in Firefox and Safari (latest versions on Mac) the name is not returned.</p>
  
  <p>console.log( arguments.callee ) returns the source of the function, but not the assigned name. arguments.callee.name returns an empty string.</p>
  
  <p>My sample code is as follows:</p>
  
  <pre><code>var testobj = {
      testfunc: function(){
          console.log( (arguments.callee.toString()).match(/function\s+(\[^\s\(]+)/) );
      }
  }
  testobj.testfunc();
  </code></pre>