Ensure _.keysIn treats primitives like objects and both _.keys and _.keysIn return empty arrays for null and undefined values.

This commit is contained in:
John-David Dalton
2014-06-22 18:50:49 -07:00
parent aac609cc38
commit 6b09cd61d2
2 changed files with 50 additions and 47 deletions

View File

@@ -6984,6 +6984,8 @@
if (object == null) {
return [];
}
object = Object(object);
var length = object.length;
length = (typeof length == 'number' && length > 0 &&
(isArray(object) || (support.nonEnumStrings && isString(object)) ||