mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Ensure functions created by _.matches don't error when comparing falsey object values. [closes #523]
This commit is contained in:
10
lodash.js
10
lodash.js
@@ -7786,7 +7786,7 @@
|
||||
// property containing a primitive value
|
||||
if (propsLength == 1 && value === value && !isObject(value)) {
|
||||
return function(object) {
|
||||
if (!hasOwnProperty.call(object, key)) {
|
||||
if (!(object && hasOwnProperty.call(object, key))) {
|
||||
return false;
|
||||
}
|
||||
// treat `-0` vs. `+0` as not equal
|
||||
@@ -7795,9 +7795,11 @@
|
||||
};
|
||||
}
|
||||
return function(object) {
|
||||
var length = propsLength,
|
||||
result = true;
|
||||
|
||||
var length = propsLength;
|
||||
if (length && !object) {
|
||||
return false;
|
||||
}
|
||||
var result = true;
|
||||
while (length--) {
|
||||
var key = props[length];
|
||||
if (!(result = hasOwnProperty.call(object, key) &&
|
||||
|
||||
Reference in New Issue
Block a user