Also check custom properties on Arrays when computing equality
[Finishes #50616649]
This commit is contained in:
@@ -2301,17 +2301,12 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
||||
bStack.push(b);
|
||||
var size = 0;
|
||||
// Recursively compare objects and arrays.
|
||||
if (className == '[object Array]') {
|
||||
// Compare array lengths to determine if a deep comparison is necessary.
|
||||
size = a.length;
|
||||
result = size == b.length;
|
||||
if (result) {
|
||||
// Deep compare the contents, ignoring non-numeric properties.
|
||||
while (size--) {
|
||||
if (!(result = eq(a[size], b[size], aStack, bStack, customTesters))) { break; }
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Compare array lengths to determine if a deep comparison is necessary.
|
||||
if (className == '[object Array]' && a.length !== b.length) {
|
||||
result = false;
|
||||
}
|
||||
|
||||
if (result) {
|
||||
// Objects with different constructors are not equivalent, but `Object`s
|
||||
// from different frames are.
|
||||
var aCtor = a.constructor, bCtor = b.constructor;
|
||||
|
||||
Reference in New Issue
Block a user