Skip to content

Instantly share code, notes, and snippets.

@Pointy
Created October 27, 2010 20:52
Show Gist options
  • Save Pointy/649960 to your computer and use it in GitHub Desktop.
Save Pointy/649960 to your computer and use it in GitHub Desktop.
function transmogrifier
Function.prototype.beforeConstruction = function(newFunc) {
var oldObj = this;
var rv = function() {
newFunc.apply(this, arguments);
oldObj.apply(this, arguments);
};
rv.prototype = oldObj.prototype;
return rv;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment