Avoid nullish being treated as plain objects in _.keysIn.

This commit is contained in:
John-David Dalton
2014-06-20 12:04:30 -07:00
parent 1c91ec69ba
commit 11c16139c2

View File

@@ -6999,8 +6999,9 @@
* // => ['x', 'y', 'z'] (property order is not guaranteed across environments)
*/
function keysIn(object) {
object = Object(object);
if (object == null) {
return [];
}
var length = object.length;
length = (typeof length == 'number' && length > 0 &&
(isArray(object) || (support.nonEnumStrings && isString(object)) ||