mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 10:57:49 +00:00
Ensure _.where handles properties with undefined properties. [closes #461]
This commit is contained in:
@@ -6950,6 +6950,9 @@
|
||||
// property containing a primitive value
|
||||
if (props.length == 1 && a === a && !isObject(a)) {
|
||||
return function(object) {
|
||||
if (!hasOwnProperty.call(object, key)) {
|
||||
return false;
|
||||
}
|
||||
var b = object[key];
|
||||
return a === b && (a !== 0 || (1 / a == 1 / b));
|
||||
};
|
||||
@@ -6959,7 +6962,9 @@
|
||||
result = false;
|
||||
|
||||
while (length--) {
|
||||
if (!(result = baseIsEqual(object[props[length]], source[props[length]], null, true))) {
|
||||
var key = props[length];
|
||||
if (!(result = hasOwnProperty.call(object, key) &&
|
||||
baseIsEqual(object[key], source[key], null, true))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user