Fix isEqual tests on older Safari.

This commit is contained in:
jdalton
2015-05-17 00:54:26 -07:00
parent 58aea21b82
commit d78ebc40ae

View File

@@ -2285,9 +2285,7 @@
if (value === other) { if (value === other) {
return true; return true;
} }
// Exit early for unlike primitive values. if (value == null || other == null || (!isObject(value) && !isObject(other))) {
if ((typeof value != 'object' && typeof other != 'object') || value == null || other == null) {
// Return `false` unless both values are `NaN`.
return value !== value && other !== other; return value !== value && other !== other;
} }
return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB); return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
@@ -8771,18 +8769,7 @@
function isEqual(value, other, customizer, thisArg) { function isEqual(value, other, customizer, thisArg) {
customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined; customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
var result = customizer ? customizer(value, other) : undefined; var result = customizer ? customizer(value, other) : undefined;
if (result !== undefined) { return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
return !!result;
}
if (value === other) {
return true;
}
// Exit early for unlike primitive values.
if ((typeof value != 'object' && typeof other != 'object') || value == null || other == null) {
// Return `false` unless both values are `NaN`.
return value !== value && other !== other;
}
return baseIsEqual(value, other, customizer);
} }
/** /**