From 816f37bdc5069a0abe59ecd2fda5d66d670e075f Mon Sep 17 00:00:00 2001 From: jdalton Date: Tue, 7 Jul 2015 08:15:09 -0700 Subject: [PATCH] Move `getData` function guard to `isLaziable. --- lodash.src.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lodash.src.js b/lodash.src.js index 5b2bf9ec7..ec80b1419 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -3998,7 +3998,7 @@ * @returns {*} Returns the metadata for `func`. */ var getData = !metaMap ? noop : function(func) { - return typeof func == 'function' ? metaMap.get(func) : undefined; + return metaMap.get(func); }; /** @@ -4280,11 +4280,12 @@ * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`. */ function isLaziable(func) { - var funcName = getFuncName(func); - if (!(funcName in LazyWrapper.prototype)) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { return false; } - var other = lodash[funcName]; if (func === other) { return true; }