Ensure _.merge skips merging when object and source are the same value.

This commit is contained in:
John-David Dalton
2015-09-09 22:56:24 -07:00
parent 4a4e54479a
commit a48f48ca95
2 changed files with 25 additions and 0 deletions

View File

@@ -2529,6 +2529,9 @@
* @param {Array} [stackB=[]] Associates values with source counterparts.
*/
function baseMerge(object, source, customizer, stackA, stackB) {
if (object === source) {
return;
}
var props = (isArray(source) || isTypedArray(source)) ? undefined : keysIn(source);
arrayEach(props || source, function(srcValue, key) {
if (props) {