From ec7dce7d5bb9ed0a100d85096ee1f67fa5dcf4a1 Mon Sep 17 00:00:00 2001 From: jdalton Date: Fri, 26 Jun 2015 08:21:27 -0700 Subject: [PATCH] Rename `_.debounce` helper `executeBoundFunction` to `complete`. --- lodash.src.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lodash.src.js b/lodash.src.js index 5d8510da8..188145bd0 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -7820,12 +7820,12 @@ maxTimeoutId = timeoutId = trailingCall = undefined; } - function executeBoundFunction(shouldExecute, clearTimeoutId) { - if (clearTimeoutId) { - clearTimeout(clearTimeoutId); + function complete(isCalled, id) { + if (id) { + clearTimeout(id); } maxTimeoutId = timeoutId = trailingCall = undefined; - if (shouldExecute) { + if (isCalled) { lastCalled = now(); result = func.apply(thisArg, args); if (!timeoutId && !maxTimeoutId) { @@ -7837,14 +7837,14 @@ function delayed() { var remaining = wait - (now() - stamp); if (remaining <= 0 || remaining > wait) { - executeBoundFunction(trailingCall, maxTimeoutId); + complete(trailingCall, maxTimeoutId); } else { timeoutId = setTimeout(delayed, remaining); } } function maxDelayed() { - executeBoundFunction(trailing || (maxWait !== wait), timeoutId); + complete(trailing || (maxWait !== wait), timeoutId); } function debounced() {