mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 16:47:49 +00:00
Fixes #409 - Unexpected arguments passed to wrapper function in _.wrap when the first argument of calling the wrapper function is an array
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
|
||||
// Create quick reference variables for speed access to core prototypes.
|
||||
var slice = ArrayProto.slice,
|
||||
concat = ArrayProto.concat,
|
||||
unshift = ArrayProto.unshift,
|
||||
toString = ObjProto.toString,
|
||||
hasOwnProperty = ObjProto.hasOwnProperty;
|
||||
@@ -584,7 +583,7 @@
|
||||
// conditionally execute the original function.
|
||||
_.wrap = function(func, wrapper) {
|
||||
return function() {
|
||||
var args = concat.apply([func], arguments);
|
||||
var args = [func].concat(slice.call(arguments, 0));
|
||||
return wrapper.apply(this, args);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user