title: How do I monkey patch an object's constructor function?
body: <p>I'd like to monkey patch the constructor for this 'Controller' object. But how do I monkey patch the constructor function so I can still call the original? This is what I've tried.</p>
  
  <pre><code>// original
  function Controller() {
      this._tag = 'div';
  }
  Controller.prototype.tag = function() {
      console.log(this._tag);
  }
  
  var c = new Controller(); 
  c.tag(); // -&gt; 'div', as expected
  
  
  // patch attempt
  var original = Controller;
  Controller = function() {
      original.apply(this);
      this._tag = 'patched'; // patch
  }
  
  var c = new Controller();
  c.tag(); // no method tag, prototype appears wiped...
  </code></pre>