Commit Graph
11 Commits
Author SHA1 Message Date
James Coglan 17749524ec Silence warnings emitted under -W2. 2017-01-11 22:37:52 +00:00
James Coglan 0eb64913ca Capture errors raise by emit() and re-raise them after the parser has finished running. 2016-12-29 00:56:55 +00:00
James Coglan 75fe55eaba Adjust how on() calls add_listener(). This is necessary because faye-websocket overrides add_listener with one argument, so users with faye-websocket locked at < 0.10 will see errors. 2015-07-10 09:22:16 +01:00
James Coglan f218999304 If an event listener emits an error, close the connection with code 1011. 2015-07-04 20:54:42 +01:00
James Coglan d69cdaba97 Allow event listeners to be passed as normal rather than block arguments.
This discourages the inappropriate use of 'return' inside event
listeners. Also, we return the listener, so that the caller has a
reference to it in case they do pass a block.
2015-07-04 19:28:49 +01:00
James Coglan 1b3f32bbc7 Trailing blank lines are bad. 2014-05-17 00:34:48 +01:00
James Coglan 46af51d04e Dup the listener list during EventEmitter#emit so that events unregistered during this call don't cause others to be skipped. 2013-08-04 13:57:08 +01:00
James Coglan cd53761699 Fix EventEmitter#listener_count in the case where the event type does not exist, and add EventEmitter#listners. 2013-08-04 12:11:37 +01:00
James Coglan 93dd655d6d Implement EventEmitter#on as a method that calls #add_listener instead of being an alias, so that overriding the latter affects the former. 2013-05-04 18:02:40 +01:00
James Coglan c9388b7627 Add a listener_count method to EventEmitter. 2013-05-04 18:00:17 +01:00
James Coglan be1f1cdc35 Rename the module to websocket-driver. 2013-05-04 16:43:25 +01:00