HubSpot/offline — pull request #10 by Dehalion (2013-10-29 15:41:14+00:00)
Title: remove endless loop in Offline.off()

If you call Offline.off() with a specific handler you get an endless loop.

First of all the loop checks `i < handlers[event].length` but in the loop `i` is decremented.

Second, the compiled JavaScript looks like this:

```
while (i < handlers[event].length) {
_ref = handlers[event][i], ctx = _ref[0], _handler = _ref[1];
if (_handler === handler) {
_results.push(handlers[event].splice(i--, 1));
} else {
_results.push(void 0);
}
}
```

In the else branch `i` isn't even touched.

I haven't used CoffeeScript so please check if i placed the `i++` right.