Also check custom properties on Arrays when computing equality

[Finishes #50616649]
This commit is contained in:
slackersoft
2014-12-16 10:22:23 -08:00
parent 503f4b7f49
commit a84202a6f9
3 changed files with 22 additions and 22 deletions

View File

@@ -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;