mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Ensure cloneByPath preserves uncloneable values. [closes #3203]
This commit is contained in:
@@ -2138,6 +2138,16 @@
|
||||
assert.strictEqual(typeof actual.a.b, 'number');
|
||||
});
|
||||
|
||||
QUnit.test('should not convert uncloneables to objects', function(assert) {
|
||||
assert.expect(2);
|
||||
|
||||
var object = { 'a': { 'b': _.constant(true) } },
|
||||
actual = fp.update('a.b')(_.identity)(object);
|
||||
|
||||
assert.strictEqual(typeof object.a.b, 'function')
|
||||
assert.strictEqual(object.a.b, actual.a.b);
|
||||
});
|
||||
|
||||
QUnit.test('should not mutate values', function(assert) {
|
||||
assert.expect(2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user