Ensure maxWait isn't processed on a leading invocation ifleading is false and there isn't an max delay queued. [closes #1964]

This commit is contained in:
John-David Dalton
2016-02-11 00:16:43 -08:00
parent d58d6f45cc
commit 1c47acd040
2 changed files with 9 additions and 4 deletions

View File

@@ -8683,7 +8683,7 @@
lastCalled = stamp;
}
var remaining = maxWait - (stamp - lastCalled),
isCalled = remaining <= 0 || remaining > maxWait;
isCalled = (remaining <= 0 || remaining > maxWait) && (leading || maxTimeoutId);
if (isCalled) {
if (maxTimeoutId) {