mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
Ensure stack is popped after recursive merge so that it doesn't affect sibling properties. [closes #2060]
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user