Created
May 16, 2014 04:43
-
-
Save STRd6/3c96054cd20584460ff0 to your computer and use it in GitHub Desktop.
Lollable
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
var Callable, c, | |
__slice = [].slice; | |
Callable = function(invoke) { | |
var fn; | |
fn = function() { | |
var _ref; | |
return (_ref = fn.invoke).call.apply(_ref, [this].concat(__slice.call(arguments))); | |
}; | |
fn.invoke = invoke; | |
return fn; | |
}; | |
c = Callable(function() { | |
return alert("hello"); | |
}); | |
c(); | |
c.invoke = function() { | |
return alert("goodbye"); | |
}; | |
c(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment