Created
January 10, 2011 20:56
-
-
Save cararemixed/773451 to your computer and use it in GitHub Desktop.
Very nice handling by CoffeeScript
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() { | |
var Foo, a; | |
var __slice = Array.prototype.slice; | |
Foo = (function() { | |
function Foo() {} | |
return Foo; | |
})(); | |
a = [1, 2, 4]; | |
(function(func, args, ctor) { | |
ctor.prototype = func.prototype; | |
var child = new ctor, result = func.apply(child, args); | |
return typeof result === "object" ? result : child; | |
})(Foo, ['abc'].concat(__slice.call(a)), function() {}); | |
}).call(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment