title: Clone javascript function
body: <p>I have a function constructor which creates an object with a function, say, <code>do_it</code>:</p>
  
  <pre><code>function do_it_maker() {
       this.do_it = function() { /* do something */ };
       this.other_do = function() { /* do anything else */ };
  }
  </code></pre>
  
  <p>And I want to create a wrapper for a <code>do_it_maker</code> object enriching the <code>do_it</code> behaviour through parasitic inheritance:</p>
  
  <pre><code>function do_it_maker_wrapper() {
       var do_it_obj = new do_it_maker();
  
       do_it_obj.do_it_original = do_it_obj.do_it;
  
       do_it_obj.do_it = function() {
           do_it_obj.do_it_original();
           /* smth_else */
       }
  
       return do_it_obj;
  }
  
  var do_it_obj = new do_it_maker_wrapper();
  do_it_obj.do_it(); // Reimplemented version.
  do_it_obj.other_do(); // Untouched.
  </code></pre>
  
  <p>My question is, will the <code>do_it_obj.do_it()</code> call cause a recursive call? or the reference to the original <code>do_it</code> function is still alive?</p>
  
  <p>I have found related questions here in <em>StackOverflow</em> but I have read contradictory answer about if the method must be cloned or not.</p>
  
  <p>So, what will it happen? In case the reference becomes recursive after changing  <code>do_it</code>, which is the most understandable and with the fewest amount of code required way of cloning that method? I'm a C++ and not-happy-with-just-copy-paste-code guy and some Javascript features look still obscure to me (I'm not clumpsy though, you can do it a bit hard).</p>