Created
August 16, 2011 02:36
-
-
Save jiggliemon/1148331 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!Function.prototype.construct) | |
Function.prototype.construct = function(aArgs) { | |
if (aArgs.constructor !== Array) | |
throw new TypeError("second argument to Function.prototype.construct must be an array"); | |
var aBoundArgs = Array.prototype.concat.apply([null], aArgs), | |
fBound = this.bind.apply(this, aBoundArgs); | |
return new fBound(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment