The ECMA standard defines a hidden, internal property [[Call]], which, if implemented, mean the object is callable / is a function.
In Python, something similar takes place, except that you can override it yourself to create your own callable objects:
>>> class B: ... def __call__(self, x,y): print x,y ... >>> inst = B() >>> inst(1,2) 1, 2
Is there any similar mechanism available in standard JavaScript? If not, what about any of the current JavaScript implementations?
As far as I know it’s not possible. It is supposed to be an internal property of an object and not exposed to the script itself. The only way I know is to define a function.
However, since functions is first class citizens you can add properties to them: