mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Ensure assignValue assigns values if they aren't the same own value. [closes #2022]
This commit is contained in:
@@ -2160,8 +2160,7 @@
|
||||
*/
|
||||
function assignValue(object, key, value) {
|
||||
var objValue = object[key];
|
||||
if ((!eq(objValue, value) ||
|
||||
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) ||
|
||||
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
|
||||
(value === undefined && !(key in object))) {
|
||||
object[key] = value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user