mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Use apply in more places.
This commit is contained in:
14
lodash.js
14
lodash.js
@@ -2736,7 +2736,7 @@
|
|||||||
path = last(path);
|
path = last(path);
|
||||||
}
|
}
|
||||||
var func = object == null ? object : object[path];
|
var func = object == null ? object : object[path];
|
||||||
return func == null ? undefined : func.apply(object, args);
|
return func == null ? undefined : apply(func, object, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -4178,7 +4178,7 @@
|
|||||||
return rest(function(args) {
|
return rest(function(args) {
|
||||||
var thisArg = this;
|
var thisArg = this;
|
||||||
return arrayFunc(iteratees, function(iteratee) {
|
return arrayFunc(iteratees, function(iteratee) {
|
||||||
return iteratee.apply(thisArg, args);
|
return apply(iteratee, thisArg, args);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -8898,7 +8898,7 @@
|
|||||||
otherArgs[index] = args[index];
|
otherArgs[index] = args[index];
|
||||||
}
|
}
|
||||||
otherArgs[start] = array;
|
otherArgs[start] = array;
|
||||||
return func.apply(this, otherArgs);
|
return apply(func, this, otherArgs);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8938,7 +8938,7 @@
|
|||||||
throw new TypeError(FUNC_ERROR_TEXT);
|
throw new TypeError(FUNC_ERROR_TEXT);
|
||||||
}
|
}
|
||||||
return function(array) {
|
return function(array) {
|
||||||
return func.apply(this, array);
|
return apply(func, this, array);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -10529,7 +10529,7 @@
|
|||||||
*/
|
*/
|
||||||
var defaults = rest(function(args) {
|
var defaults = rest(function(args) {
|
||||||
args.push(undefined, assignInDefaults);
|
args.push(undefined, assignInDefaults);
|
||||||
return assignInWith.apply(undefined, args);
|
return apply(assignInWith, undefined, args);
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10552,7 +10552,7 @@
|
|||||||
*/
|
*/
|
||||||
var defaultsDeep = rest(function(args) {
|
var defaultsDeep = rest(function(args) {
|
||||||
args.push(undefined, mergeDefaults);
|
args.push(undefined, mergeDefaults);
|
||||||
return mergeWith.apply(undefined, args);
|
return apply(mergeWith, undefined, args);
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -12720,7 +12720,7 @@
|
|||||||
*/
|
*/
|
||||||
var attempt = rest(function(func, args) {
|
var attempt = rest(function(func, args) {
|
||||||
try {
|
try {
|
||||||
return func.apply(undefined, args);
|
return apply(func, undefined, args);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return isError(e) ? e : new Error(e);
|
return isError(e) ? e : new Error(e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user