-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
…om different frames.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -847,8 +847,13 @@ | |
} | ||
} | ||
} else { | ||
// Objects with different constructors are not equivalent. | ||
if ('constructor' in a != 'constructor' in b || a.constructor != b.constructor) return false; | ||
// Objects with different constructors are not equivalent, but `Object`s | ||
// from different frames are. | ||
var aCtor = a.constructor, bCtor = b.constructor; | ||
if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jashkenas
Author
Owner
|
||
_.isFunction(bCtor) && (bCtor instanceof bCtor))) { | ||
return false; | ||
} | ||
// Deep compare objects. | ||
for (var key in a) { | ||
if (_.has(a, key)) { | ||
|
aCtor instanceof aCtor
? Shouldn't that only be true for the nativeFunction
andObject
constructors? What kind of test is that?