Ensure _.merge works with _.reduce.

Former-commit-id: de53bfd024c7a088c98ee94c95d0c57fb00ed032
This commit is contained in:
John-David Dalton
2012-11-12 07:35:05 -08:00
parent 6f258000fe
commit d29b8eca3c
3 changed files with 42 additions and 34 deletions

View File

@@ -1630,7 +1630,7 @@
stackA = args[3],
stackB = args[4];
if (indicator !== objectRef) {
if (typeof indicator != 'number' && indicator !== indicatorObject) {
stackA = [];
stackB = [];
length = args.length;
@@ -1658,7 +1658,7 @@
: (isPlainObject(value) ? value : {})
);
// recursively merge objects and arrays (susceptible to call stack limits)
object[key] = merge(value, source, objectRef, stackA, stackB);
object[key] = merge(value, source, indicatorObject, stackA, stackB);
}
} else if (source != null) {
object[key] = source;