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

9
dist/lodash.js vendored
View File

@@ -1820,10 +1820,6 @@
}
}
if (!found) {
value = isArr
? (isArray(value) ? value : [])
: (isPlainObject(value) ? value : {});
var isShallow;
if (callback) {
result = callback(value, source);
@@ -1831,6 +1827,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);