Created
February 9, 2010 16:46
-
-
Save kentaromiura/299387 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
Function.implement('Invoke', | |
function(args){ | |
var tmp = Class.instantiate(this); | |
var init = this.prototype.initialize; | |
if(init){ | |
init.apply(tmp,$splat(args)); | |
} | |
return tmp; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
with this little modification if a single element is passed throught it $splat that into an Array :)