Skip to content

Instantly share code, notes, and snippets.

@kentaromiura
Created February 9, 2010 16:46
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 kentaromiura/299387 to your computer and use it in GitHub Desktop.
Save kentaromiura/299387 to your computer and use it in GitHub Desktop.
Function.implement('Invoke',
function(args){
var tmp = Class.instantiate(this);
var init = this.prototype.initialize;
if(init){
init.apply(tmp,$splat(args));
}
return tmp;
});
@kentaromiura
Copy link
Author

with this little modification if a single element is passed throught it $splat that into an Array :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment