mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Update docs and builds.
Former-commit-id: 27acae75d0412c0e94caa857d861522cbbc6b1a8
This commit is contained in:
16
dist/lodash.underscore.js
vendored
16
dist/lodash.underscore.js
vendored
@@ -546,21 +546,22 @@
|
||||
* @returns {Function} Returns the new bound function.
|
||||
*/
|
||||
function createBound(func, thisArg, partialArgs, partialRightArgs, isPartial, isAlt) {
|
||||
var isFunc = isFunction(func);
|
||||
var isBindKey = isAlt && !isPartial,
|
||||
isFunc = isFunction(func);
|
||||
|
||||
// except for `_.bindKey`, throw when `func` is not a function
|
||||
if (!isFunc && (isPartial || !isAlt)) {
|
||||
// throw if `func` is not a function when not behaving as `_.bindKey`
|
||||
if (!isFunc && !isBindKey) {
|
||||
throw new TypeError;
|
||||
}
|
||||
var key = thisArg;
|
||||
|
||||
// juggle arguments for `_.bindKey`
|
||||
if (!isPartial && isAlt) {
|
||||
// juggle arguments for `_.bindKey` behavior
|
||||
if (isBindKey) {
|
||||
thisArg = func;
|
||||
}
|
||||
// use `Function#bind` if it exists and is fast
|
||||
// (in V8 `Function#bind` is slower except when partially applied)
|
||||
if (!isPartial && !isAlt && (support.fastBind || (nativeBind && partialArgs.length))) {
|
||||
if (!isPartial && !isAlt && !partialRightArgs.length && (support.fastBind || (nativeBind && partialArgs.length))) {
|
||||
var bound = nativeBind.call.apply(nativeBind, concat.call(arrayRef, func, thisArg, partialArgs));
|
||||
}
|
||||
else {
|
||||
@@ -570,7 +571,7 @@
|
||||
var args = arguments,
|
||||
thisBinding = isPartial ? this : thisArg;
|
||||
|
||||
if (!isFunc) {
|
||||
if (isBindKey) {
|
||||
func = thisArg[key];
|
||||
}
|
||||
if (partialArgs.length || partialRightArgs.length) {
|
||||
@@ -3475,6 +3476,7 @@
|
||||
}
|
||||
var type = typeof func;
|
||||
if (type != 'function') {
|
||||
// handle "_.pluck" style callback shorthands
|
||||
if (type != 'object') {
|
||||
return function(object) {
|
||||
return object[func];
|
||||
|
||||
Reference in New Issue
Block a user