From fb00ba9efd9f68f6e6e587cd3c3d45ffc5a738a8 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 28 Apr 2014 08:30:32 -0700 Subject: [PATCH] Cleanup `_.isObject` and `_.isRegExp`. --- lodash.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lodash.js b/lodash.js index daafb927d..de0bbd5c5 100644 --- a/lodash.js +++ b/lodash.js @@ -6372,7 +6372,7 @@ // and avoid a V8 bug // https://code.google.com/p/v8/issues/detail?id=2291 var type = typeof value; - return (value && (type == 'function' || type == 'object')) || false; + return (type == 'function' || (value && type == 'object')) || false; } /** @@ -6515,9 +6515,7 @@ * // => false */ function isRegExp(value) { - var type = typeof value; - return (value && (type == 'function' || type == 'object') && - toString.call(value) == regexpClass) || false; + return (isObject(value) && toString.call(value) == regexpClass) || false; } /**