title: How to prevent JS minification from removing names of named-function-expressions?
body: <p>I have this function on an object that I need to trace REALLY BADLY, along with the parent caller of the invocation and arguments passed to the caller.</p>
  
  <p>This well works until minified:</p>
  
  <pre><code>var foo = {
      FunctionToBeLogged: function GiveMeAName() {
          console.log('&gt; %s called from %s - args: %o',
                      arguments.callee.name,
                      arguments.callee.caller.name,
                      arguments.callee.caller.arguments);
    }
  }
  
  var bar = {
    A: function A(something) {
      foo.FunctionToBeLogged('nothing', 12, true);
    },  
    B: function B(whatever, doesntMatter) {
      foo.FunctionToBeLogged('nothing', 12, true);
    }
  }
  
  bar.A(1.2, 'Fred', { });    // &gt; GiveMeAName called from A - args: [1.2, "Fred", Object]
  bar.B('Barney', 42, false); // &gt; GiveMeAName called from B - args: ["Barney", 42, false]
  </code></pre>
  
  <p><strong>Minification</strong> gets rid of the these names and my output becomes:</p>
  
  <pre><code>bar.A(1.2, 'Fred', { });    // &gt;  called from  - args: [1.2, "Fred", Object]
  bar.B('Barney', 42, false); // &gt;  called from  - args: ["Barney", 42, false]
  </code></pre>
  
  <p>I really don't want to go and create function declarations and assignments because I have TONS of them (I inherited this code with 7,564... and I can easily run some regex sub to name the function expressions.)</p>
  
  <p>What can I do to prevent the minifier to get rid of my these function names?</p>