From 584bb00cfc477a960ea8ad19994047c5fbc6d1d7 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 15 Dec 2012 13:01:43 -0800 Subject: [PATCH] Use the `indicatorObject` instead of a boolean in the internals of `_.reduce` and `_.reduceRight`. Former-commit-id: b83d1ef428941f15a6633c1b16b9373210149318 --- lodash.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lodash.js b/lodash.js index c628a84d7..9af80e18a 100644 --- a/lodash.js +++ b/lodash.js @@ -613,8 +613,8 @@ * @param {Function|String} [func=identity|property] The function called per * iteration or property name to query. * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @param {Boolean} [accumulating] A flag to indicate creating a callback - * that accepts an `accumulator` argument. + * @param {Object} [accumulating] Used to indicate that the callback should + * accept an `accumulator` argument. * @returns {Function} Returns a callback function. */ function createCallback(func, thisArg, accumulating) { @@ -2415,7 +2415,7 @@ */ function reduce(collection, callback, accumulator, thisArg) { var noaccum = arguments.length < 3; - callback = createCallback(callback, thisArg, true); + callback = createCallback(callback, thisArg, indicatorObject); if (isArray(collection)) { var index = -1, @@ -2466,7 +2466,7 @@ } else if (noCharByIndex && isString(collection)) { iteratee = collection.split(''); } - callback = createCallback(callback, thisArg, true); + callback = createCallback(callback, thisArg, indicatorObject); forEach(collection, function(value, index, collection) { index = props ? props[--length] : --length; accumulator = noaccum