Closed xadn closed 9 years ago
I want to make sure that this module stays ES3 compatible so I think the best way would be just wrap clearTimeout
in a function:
tick.timers[name] = {
timer: setInterval(tick.tock(name), ms(time)),
clear: function clear(what) { clearInterval(what); }
fns: [fn]
};
But we probably have to do that for every setup.
Awesome, thanks the pull request and processing the changes. I'll publish a new version in a bit.
I noticed this while trying Liferaft in the browser. Calling
clearTimeout
liketimer.clear
changes the binding ofthis
and causes an error in Chrome, but I'm not sure why or if this happens in other browsers. BindingclearTimeout
tonull
seems to fix it.Note: this fails the code coverage precommit hook, not sure how to best test this with the current mocha setup.