-
Notifications
You must be signed in to change notification settings - Fork 208
Open
Description
The following test fails
describe('eql', function () {
it('should not remove undefined', function () {
var arr = []
arr.push('1')
arr.push('2')
arr.push(undefined)
expect(arr).to.eql(['1', '2', undefined])
})
})This is because the keys function used here will not iterate over an undefined array item in IE8 unless the value was pushed to the array.
If on line 941 the keys function is called on a duplicate of the array, this could be resolved.
try{
var ka, kb, key, i;
if (isArray(a) && isArray(b)) {
ka = keys(cloneArray(a));
kb = keys(cloneArray(b));
} else {
ka = keys(a);
kb = keys(b);
}
} catch (e) {//happens when one is a string literal and the other isn't
return false;
}
function cloneArray (arr) {
var clone = [];
for (var i = 0; i < arr.length; i++) {
clone.push(arr[i]);
}
return clone;
}
function isArray (obj) {
return Object.prototype.toString.call(obj) === '[object Array]';
}Metadata
Metadata
Assignees
Labels
No labels