From a3c215919d6dafa6b6e61fa4c2a67a7ee42f9b41 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 23 Sep 2016 15:15:09 -0700 Subject: [PATCH] Create more error text constants. --- lodash.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lodash.js b/lodash.js index c866b28ee..be5bbd190 100644 --- a/lodash.js +++ b/lodash.js @@ -17,8 +17,11 @@ /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; + /** Error message constants. */ + var TRY_ES_SHIMS = 'Try https://github.com/es-shims.', + CORE_ERROR_TEXT = 'Unsupported core-js use. ' + TRY_ES_SHIMS, + FUNC_ERROR_TEXT = 'Expected a function', + SHIM_ERROR_TEXT = 'Unsupported method. ' + TRY_ES_SHIMS; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; @@ -11145,7 +11148,7 @@ * // => false */ var isArray = Array.isArray || (Array.isArray = function() { - throw new Error('This method is not supported. Try https://github.com/es-shims.'); + throw new Error(SHIM_ERROR_TEXT); }); /** @@ -11780,7 +11783,7 @@ */ function isNative(value) { if (isMaskable(value)) { - throw new Error('This method is not supported with core-js. Try https://github.com/es-shims.'); + throw new Error(CORE_ERROR_TEXT); } return baseIsNative(value); }