diff --git a/lodash.js b/lodash.js index 0e97f1309..32c9f1f44 100644 --- a/lodash.js +++ b/lodash.js @@ -4446,9 +4446,9 @@ var newValue = customizer ? customizer(object[key], source[key], key, object, source) - : source[key]; + : undefined; - assignValue(object, key, newValue); + assignValue(object, key, newValue === undefined ? source[key] : newValue); } return object; } diff --git a/test/test.js b/test/test.js index 688b63c2d..4f2364465 100644 --- a/test/test.js +++ b/test/test.js @@ -1454,7 +1454,7 @@ QUnit.test('`_.' + methodName + '` should work with a `customizer` that returns `undefined`', function(assert) { assert.expect(1); - var expected = { 'a': undefined }; + var expected = { 'a': 1 }; assert.deepEqual(func({}, expected, noop), expected); }); });