Cleanup and comment _.merge's _.reduce support.

Former-commit-id: 2cfc41f1c00a7a3981c51be7e8005f0cc95ac692
This commit is contained in:
John-David Dalton
2012-11-12 07:41:31 -08:00
parent d873890e46
commit 56bd430983
2 changed files with 7 additions and 3 deletions

View File

@@ -1630,10 +1630,14 @@
stackA = args[3],
stackB = args[4];
if (typeof indicator != 'number' && indicator !== indicatorObject) {
if (indicator !== indicatorObject) {
stackA = [];
stackB = [];
length = args.length;
// work with `_.reduce` by only using its callback `accumulator` and `value` arguments
if (typeof indicator != 'number') {
length = args.length;
}
}
while (++index < length) {
forOwn(args[index], function(source, key) {