From 4c8836a24ae7b6189810a0a2561ef2a78a6749ea Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 1 Apr 2016 19:06:36 -0700 Subject: [PATCH] Cleanup `_.isNative`. --- lodash.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lodash.js b/lodash.js index f54138d67..33755f15f 100644 --- a/lodash.js +++ b/lodash.js @@ -10855,13 +10855,11 @@ * // => false */ function isNative(value) { - if (value == null) { + if (!isObject(value)) { return false; } - if (isObjectLike(value)) { - return (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); - } - return reIsNative.test(toSource(value)); + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); } /**