From 4cc3fcb6e87a2835e48fae0d59e68fb326a8aa4b Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 5 May 2013 23:49:37 -0700 Subject: [PATCH] Ensure unknown `objectTypes` return `false`. Former-commit-id: a60236ecd8908a91c0268d71d5710665986f1ceb --- lodash.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lodash.js b/lodash.js index fc78ea8fa..20ca1042c 100644 --- a/lodash.js +++ b/lodash.js @@ -1810,7 +1810,7 @@ // http://es5.github.com/#x8 // and avoid a V8 bug // http://code.google.com/p/v8/issues/detail?id=2291 - return value ? objectTypes[typeof value] : false; + return !!(value && objectTypes[typeof value]); } /** @@ -1931,7 +1931,7 @@ * // => true */ function isRegExp(value) { - return value ? (objectTypes[typeof value] && toString.call(value) == regexpClass) : false; + return !!(value && objectTypes[typeof value]) && toString.call(value) == regexpClass); } /**