mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 23:37:49 +00:00
Ensure _.debounce passes vendor/underscore unit tests.
This commit is contained in:
10
lodash.js
10
lodash.js
@@ -5489,7 +5489,9 @@
|
||||
thisArg = this;
|
||||
trailingCall = trailing && (timeoutId || !leading);
|
||||
|
||||
if (maxWait !== false) {
|
||||
if (maxWait === false) {
|
||||
var leadingCall = leading && !timeoutId;
|
||||
} else {
|
||||
if (!maxTimeoutId && !leading) {
|
||||
lastCalled = stamp;
|
||||
}
|
||||
@@ -5505,12 +5507,12 @@
|
||||
maxTimeoutId = setTimeout(maxDelayed, remaining);
|
||||
}
|
||||
}
|
||||
else if (leading && !timeoutId) {
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
if (!timeoutId && wait !== maxWait) {
|
||||
timeoutId = setTimeout(delayed, wait);
|
||||
}
|
||||
if (leadingCall) {
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user