From 816edcce2efbc43409107c51ae3f57ff57de7709 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 28 Apr 2016 14:55:25 -0700 Subject: [PATCH] Rename `getPlaceholder` to `getHolder`. --- lodash.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lodash.js b/lodash.js index dd0466f91..d1029bf5f 100644 --- a/lodash.js +++ b/lodash.js @@ -4468,7 +4468,7 @@ var length = arguments.length, args = Array(length), index = length, - placeholder = getPlaceholder(wrapper); + placeholder = getHolder(wrapper); while (index--) { args[index] = arguments[index]; @@ -4590,7 +4590,7 @@ args[index] = arguments[index]; } if (isCurried) { - var placeholder = getPlaceholder(wrapper), + var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder); } if (partials) { @@ -5262,6 +5262,18 @@ return result; } + /** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getHolder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } + /** * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, * this function returns the custom method, otherwise it returns `baseIteratee`. @@ -5337,18 +5349,6 @@ return isNative(value) ? value : undefined; } - /** - * Gets the argument placeholder value for `func`. - * - * @private - * @param {Function} func The function to inspect. - * @returns {*} Returns the placeholder value. - */ - function getPlaceholder(func) { - var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; - return object.placeholder; - } - /** * Gets the `[[Prototype]]` of `value`. * @@ -9304,7 +9304,7 @@ var bind = rest(function(func, thisArg, partials) { var bitmask = BIND_FLAG; if (partials.length) { - var holders = replaceHolders(partials, getPlaceholder(bind)); + var holders = replaceHolders(partials, getHolder(bind)); bitmask |= PARTIAL_FLAG; } return createWrapper(func, bitmask, thisArg, partials, holders); @@ -9358,7 +9358,7 @@ var bindKey = rest(function(object, key, partials) { var bitmask = BIND_FLAG | BIND_KEY_FLAG; if (partials.length) { - var holders = replaceHolders(partials, getPlaceholder(bindKey)); + var holders = replaceHolders(partials, getHolder(bindKey)); bitmask |= PARTIAL_FLAG; } return createWrapper(key, bitmask, object, partials, holders); @@ -9899,7 +9899,7 @@ * // => 'hi fred' */ var partial = rest(function(func, partials) { - var holders = replaceHolders(partials, getPlaceholder(partial)); + var holders = replaceHolders(partials, getHolder(partial)); return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders); }); @@ -9936,7 +9936,7 @@ * // => 'hello fred' */ var partialRight = rest(function(func, partials) { - var holders = replaceHolders(partials, getPlaceholder(partialRight)); + var holders = replaceHolders(partials, getHolder(partialRight)); return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders); });