Make _.defer and _.delay slice arguments in the timeout callback.

This commit is contained in:
John-David Dalton
2014-11-05 01:59:17 -08:00
parent 233adab647
commit 7ce8304ce6

View File

@@ -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);
}
/**