documentcloud/underscore — Issue #502: _.throttle()'d function is never called when frequency is high
Author: JulesAU
Created: 2012-03-08 06:27:53+00:00
State: open

Test code (node.JS):

````javascript
var underscore = require('underscore');

function y() {
console.log('XXX');
}

var x = underscore.throttle(y, 100);

while (1) {
x();
}
````

Expected: 'XXX' echoed every 100ms

Actual: XXX is echoed one time only.

In the inner loop in underscore.js, `if (throttling) {` is always true. So it seems to be a logic error rather than a problem with the event stack being saturated.