Allow arrays from different frames or contexts to be equal
This commit is contained in:
@@ -167,11 +167,14 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
||||
|
||||
if (result) {
|
||||
// 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) &&
|
||||
isFunction(bCtor) && (bCtor instanceof bCtor))) {
|
||||
return false;
|
||||
// or `Array`s from different frames are.
|
||||
var areArrays = className === '[object Array]';
|
||||
if (!areArrays) {
|
||||
var aCtor = a.constructor, bCtor = b.constructor;
|
||||
if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor &&
|
||||
isFunction(bCtor) && bCtor instanceof bCtor)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Deep compare objects.
|
||||
for (var key in a) {
|
||||
|
||||
Reference in New Issue
Block a user