Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@kentaromiura kentaromiura commented Apr 19, 2010

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