From df4e306c643de6f1322f3e0a121e98a1ce30533b Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 8 Aug 2014 10:43:26 -0700 Subject: [PATCH] Add `length` check to avoid extra work in `initArrayClone`. --- lodash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index ee8ecf89f..cb30dd3ed 100644 --- a/lodash.js +++ b/lodash.js @@ -2849,7 +2849,7 @@ } } // add array properties assigned by `RegExp#exec` - if (typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { result.index = array.index; result.input = array.input; }