mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
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:
@@ -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() {
|
||||
|
||||
@@ -82,6 +82,9 @@
|
||||
'isEqual': [
|
||||
'Died on test #60',
|
||||
'Died on test #63'
|
||||
],
|
||||
'keys': [
|
||||
'is not fooled by sparse arrays; see issue #95'
|
||||
]
|
||||
},
|
||||
'Utility': {
|
||||
@@ -122,6 +125,7 @@
|
||||
}
|
||||
delete QUnit.config.excused.Chaining;
|
||||
delete QUnit.config.excused.Collections.where;
|
||||
delete QUnit.config.excused.Objects.keys;
|
||||
delete QUnit.config.excused.Utility['_.escape'];
|
||||
delete QUnit.config.excused.Utility['_.unescape'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user