@@ -116,6 +116,7 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// Identical objects are equal. `0 === -0`, but they aren't identical.
|
||||
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
|
||||
if (a === b) {
|
||||
@@ -167,6 +168,36 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
||||
}
|
||||
return result;
|
||||
// RegExps are compared by their source patterns and flags.
|
||||
case '[object ArrayBuffer]':
|
||||
// If we have an instance of ArrayBuffer the Uint8Array ctor
|
||||
// will be defined as well
|
||||
var arrayA = new Uint8Array(a);
|
||||
var arrayB = new Uint8Array(b);
|
||||
var arrayALength = arrayA.length;
|
||||
var arrayBLength = arrayB.length;
|
||||
|
||||
diffBuilder.withPath('length', function() {
|
||||
if (arrayALength !== arrayBLength) {
|
||||
diffBuilder.record(arrayALength, arrayBLength);
|
||||
result = false;
|
||||
}
|
||||
});
|
||||
|
||||
for (i = 0; i < arrayALength || i < arrayBLength; i++) {
|
||||
diffBuilder.withPath(i, function() {
|
||||
if (i >= arrayBLength) {
|
||||
diffBuilder.record(arrayA[i], void 0, actualArrayIsLongerFormatter);
|
||||
result = false;
|
||||
} else if (i >= arrayALength){
|
||||
diffBuilder.record(void 0, arrayB[i], actualArrayIsLongerFormatter);
|
||||
result = false;
|
||||
} else if (arrayA[i] !== arrayB[i]) {
|
||||
diffBuilder.record(arrayA[i], arrayB[i]);
|
||||
result = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
return result;
|
||||
case '[object RegExp]':
|
||||
return a.source == b.source &&
|
||||
a.global == b.global &&
|
||||
|
||||
Reference in New Issue
Block a user