jashkenas/underscore — pull request #1473 by BlakeSimpson (2014-02-13 14:43:56+00:00)
Title: Allow _.throttle to function correctly after the system time is updated

I have found that if the system time is moved backwards, calls to throttle will stop executing.

To test this, if the system time is moved backwards by an hour then the `remaining` variable in `_.throttle` containing the time offset becomes a large positive integer and the throttle callback will not be called until the adjusted hour time difference has passed, instead of the expected wait time.

For this reason I suggest that an additional check is made to see if `remaining` exceeds the `wait` time which will then clear the existing timeout and return the method to a normal state.

I have tested this in a project and provided a unit test as proof.