Hello
I'm having this problem in a real-world Project.
http://stackoverflow.com/questions/124326/how-to-convert-an-object-into-a-function-in-javascript
I need at least as Steve said "to assign a method operator() to an object". Re-assign is not an option, because the object is too complex and it's not created within Javascript.
I have an object x (but not a function). And I want to call a method this way
x()
I tried to add an "apply" and a "call" method but it didn't worked. It seems that Javascript remember always that "is not a function" (that's the error I obtain always). Is there a way to "hack" the Spidermonkey engine to achive this ?
Thanks in Advance.
Gustavo