wow, logic fail

if you called the same event twice, it will reduce count anyways (so I
could have event.any(a,b,c) and call a three times and it would
complete.
v1.18.x
psychobunny 10 years ago
parent 27c214486b
commit edf37f3e0c

@ -6,7 +6,9 @@ var eventEmitter = new (require('events')).EventEmitter();
eventEmitter.all = function(events, callback) {
function onEvent(event) {
eventEmitter.on(events[event], function() {
events.splice(events.indexOf(event), 1);
if (events.indexOf(event) !== -1) {
events.splice(events.indexOf(event), 1);
}
if (events.length === 0) {
callback();

Loading…
Cancel
Save