Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emitting to a room can't work with CoffeeScript since "in" is a key word in CS. #1191

Closed
OrionChang opened this issue Mar 15, 2013 · 3 comments

Comments

@OrionChang
Copy link

Emitting an event to all clients in a particular room

io.sockets.in('room').emit('event_name', data)

will be compiled to

io.sockets"in".emit('event_name', data)

@tr00per
Copy link

tr00per commented Mar 15, 2013

This looks more like a CoffeeScript issue. This "in" should be treated as a function call. It's a parsing inaccuracy in CS. "In" is also a keyword in JS and it's not complaining.

@prajwalkman
Copy link

You should be able to use io.sockets['in']('room').emit('event_name', data) while Jashkenas fixes this.

@prajwalkman
Copy link

Oops; It's already fixed in the latest coffeescript release: 1.6.2

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants