Ensure stack is popped after recursive merge so that it doesn't affect sibling properties. [closes #2060]

This commit is contained in:
John-David Dalton
2016-02-26 09:33:30 -08:00
parent ff7d79d5fc
commit 0b76654b71
2 changed files with 2 additions and 1 deletions

View File

@@ -3209,6 +3209,7 @@
// Recursively merge objects and arrays (susceptible to call stack limits).
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
}
stack['delete'](srcValue);
assignMergeValue(object, key, newValue);
}

View File

@@ -14023,7 +14023,7 @@
source.bar.b = source.foo.b;
var actual = _.merge(object, source);
assert.ok(actual.bar.b === actual.foo.b && actual.foo.b.c.d === actual.foo.b.c.d.foo.b.c.d);
assert.ok(actual.bar.b !== actual.foo.b && actual.foo.b.c.d === actual.foo.b.c.d.foo.b.c.d);
});
QUnit.test('should work with four arguments', function(assert) {