Ensure cloneByPath preserves uncloneable values. [closes #3203]

This commit is contained in:
John-David Dalton
2017-06-14 07:17:44 -07:00
parent 912d6b04a1
commit 5a3ff73997
3 changed files with 19 additions and 2 deletions

View File

@@ -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);