From 7ce8304ce6ddba0be472cec7e3ea4aef44652e6d Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 5 Nov 2014 01:59:17 -0800 Subject: [PATCH] Make `_.defer` and `_.delay` slice `arguments` in the timeout callback. --- lodash.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lodash.js b/lodash.js index 19eb43d47..fd82ec29c 100644 --- a/lodash.js +++ b/lodash.js @@ -6523,8 +6523,8 @@ if (!isFunction(func)) { throw new TypeError(FUNC_ERROR_TEXT); } - var args = slice(arguments, 1); - return setTimeout(function() { func.apply(undefined, args); }, 1); + var args = arguments; + return setTimeout(function() { func.apply(undefined, slice(args, 1)); }, 1); } /** @@ -6547,8 +6547,8 @@ if (!isFunction(func)) { throw new TypeError(FUNC_ERROR_TEXT); } - var args = slice(arguments, 2); - return setTimeout(function() { func.apply(undefined, args); }, wait); + var args = arguments; + return setTimeout(function() { func.apply(undefined, slice(args, 2)); }, wait); } /**