mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +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).
|
// Recursively merge objects and arrays (susceptible to call stack limits).
|
||||||
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
|
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
|
||||||
}
|
}
|
||||||
|
stack['delete'](srcValue);
|
||||||
assignMergeValue(object, key, newValue);
|
assignMergeValue(object, key, newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14023,7 +14023,7 @@
|
|||||||
source.bar.b = source.foo.b;
|
source.bar.b = source.foo.b;
|
||||||
|
|
||||||
var actual = _.merge(object, source);
|
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) {
|
QUnit.test('should work with four arguments', function(assert) {
|
||||||
|
|||||||
Reference in New Issue
Block a user