Flotype / now

NowJS makes it easy to build real-time web apps using JavaScript
http://www.nowjs.com
MIT License
1.91k stars 175 forks source link

Redeclaration of a Function in the now namespace fails #152

Closed toha closed 13 years ago

toha commented 13 years ago

I declared a function on the client

now.foo = function() { console.log("foo"); };

and I can use it on the server with

user.now.foo();

But, if i redeclare the function in the client

now.foo = function() { console.log("bar"); };

I cannot access it from the server anymore:

TypeError: Property 'foo' of object # is not a function.

On first declaration, nowjs sends: 5:::{"name":"rv","args":[{"now.foo":{"fqn":"now.foo"}}]}

and on the second declaration: 5:::{"name":"rv","args":[{"now.foo.fqn":"now.foo"}]}

ericz commented 13 years ago

Reproduced. Fixing...

ericz commented 13 years ago

Hi toha, this issue has been fixed in the latest GH master.

Eric

ericz commented 13 years ago

Additionally I've updated our test suite to ensure this does not go uncaught again.