Ensure sparse arrays are treated as dense by _.keys and _.keysIn and ensure support for string objects in _.keys and _.keysIn.

This commit is contained in:
John-David Dalton
2014-03-25 09:26:20 -07:00
parent 0ab5d6a7b8
commit c721721fc5
3 changed files with 37 additions and 16 deletions

View File

@@ -5091,10 +5091,10 @@
deepEqual(_.keys(object), ['a', 'b']);
});
test('should work with sparse arrays', 1, function() {
test('should treat sparse arrays as dense', 1, function() {
var array = [1];
array[2] = 3;
deepEqual(_.keys(array), ['0', '2']);
deepEqual(_.keys(array), ['0', '1', '2']);
});
test('should work with `arguments` objects (test in IE < 9)', 1, function() {