Ensure _.where handles properties with undefined properties. [closes #461]

This commit is contained in:
John-David Dalton
2014-01-27 08:16:10 -08:00
parent 752545ec0e
commit 6cef7d5060
8 changed files with 69 additions and 38 deletions

View File

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