title: why the result is inconsistent with expected in this decorate function?
body: <p>This is a chain function call, I expect that all the output block between '--------' and next '---------' should be exactly same, but when I try running it, the content between first block' ------' of the output is different from all the following block of output?</p>
  
  <p>The first two lines of output is:</p>
  
  <pre><code>function(){alert('original')}
  function(){alert('original')}
  --------------
  </code></pre>
  
  <p>the following are: </p>
  
  <pre><code>function(){alert('original')}
  function m(){
      console.log(f.toString());
      console.log(fun1.toString());
      console.log('--------');
  
      return m; 
  }
  --------------
  .... (repeat)
  --------------
  </code></pre>
  
  <p>the code is following:</p>
  
  <pre><code>&lt;script&gt;
  var fun1 = function(){alert('original')};
  function decoratefun (f){
      return (function m(){
          console.log(f.toString());
          console.log(fun1.toString());
          console.log('--------');
  
          return m; 
      })();
  }
  
  var fun1 = decoratefun(fun1);
  
  fun1()()()(); 
  &lt;/script&gt;
  </code></pre>