From 11c16139c2fc06cf52a73b4308755c787dbf147a Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 20 Jun 2014 12:04:30 -0700 Subject: [PATCH] Avoid nullish being treated as plain objects in `_.keysIn`. --- lodash.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lodash.js b/lodash.js index 6aa1519f5..1f7b1026f 100644 --- a/lodash.js +++ b/lodash.js @@ -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)) ||