Created
March 12, 2010 07:51
-
-
Save xulapp/330137 to your computer and use it in GitHub Desktop.
__call__ in JavaScript
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 Callable() { | |
var self = function Callable() | |
this.__call__.apply(this, arguments); | |
self.__proto__ = Callable.prototype; | |
return self; | |
} | |
Callable.prototype = { | |
constructor: Callable, | |
__proto__: Function.prototype, | |
__call__: function __call__() { | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
♥