Ensure _.isEqual works with objects created by Object.create(null).

This commit is contained in:
John-David Dalton
2013-10-17 22:53:40 -07:00
parent 0b4fe85b33
commit 31e86a36f8
8 changed files with 124 additions and 94 deletions

View File

@@ -1277,10 +1277,10 @@
ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor;
// non `Object` object instances with different constructors are not equal
if (ctorA != ctorB && !(
isFunction(ctorA) && ctorA instanceof ctorA &&
isFunction(ctorB) && ctorB instanceof ctorB
)) {
if (ctorA != ctorB &&
!(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) &&
(!nativeCreate || ('constructor' in a && 'constructor' in b))
) {
return false;
}
}