Ensure _.merge passes the right arguments to the callback when comparing objects. [closes #231]

Former-commit-id: 7c1ff861f753d3a2bdf62a753c94df2052d03d78
This commit is contained in:
John-David Dalton
2013-04-08 21:01:57 -07:00
parent 4a11a3559d
commit ad0c287053
7 changed files with 115 additions and 91 deletions

View File

@@ -2039,10 +2039,6 @@
}
}
if (!found) {
value = isArr
? (isArray(value) ? value : [])
: (isPlainObject(value) ? value : {});
var isShallow;
if (callback) {
result = callback(value, source);
@@ -2050,6 +2046,11 @@
value = result;
}
}
if (!isShallow) {
value = isArr
? (isArray(value) ? value : [])
: (isPlainObject(value) ? value : {});
}
// add `source` and associated `value` to the stack of traversed objects
stackA.push(source);
stackB.push(value);