Skip to content

Instantly share code, notes, and snippets.

@abozhilov
Created October 31, 2012 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abozhilov/3987029 to your computer and use it in GitHub Desktop.
Save abozhilov/3987029 to your computer and use it in GitHub Desktop.
Function.prototype.new
Function.prototype.new = function () {
var ctor = this;
function F(){return ctor.apply(this, arguments);}
F.prototype = ctor.prototype;
return new F;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment