From a542f8ab542cc7ac1ead567ed74c38a7b24ea789 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 19 May 2016 13:52:18 -0700 Subject: [PATCH] Remove `clearTimeout` use. --- lodash.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lodash.js b/lodash.js index 7dae9e29c..ac687729d 100644 --- a/lodash.js +++ b/lodash.js @@ -249,7 +249,7 @@ 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', 'Promise', 'Reflect', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', - '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' + '_', 'isFinite', 'parseInt', 'setTimeout' ]; /** Used to make template sourceURLs easier to identify. */ @@ -1296,8 +1296,7 @@ splice = arrayProto.splice; /** Built-in method references that are mockable. */ - var clearTimeout = function(id) { return context.clearTimeout.call(root, id); }, - setTimeout = function(func, wait) { return context.setTimeout.call(root, func, wait); }; + var setTimeout = function(func, wait) { return context.setTimeout.call(root, func, wait); }; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil, @@ -9679,7 +9678,6 @@ } function trailingEdge(time) { - clearTimeout(timerId); timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been @@ -9692,9 +9690,6 @@ } function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = undefined; } @@ -9717,7 +9712,6 @@ } if (maxing) { // Handle invocations in a tight loop. - clearTimeout(timerId); timerId = setTimeout(timerExpired, wait); return invokeFunc(lastCallTime); }