From 45ac7f3bccb9d9d1374c59a22bbb5d4b17bebb28 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 2 Feb 2018 15:50:02 -0800 Subject: [PATCH] Support symbols in property paths of `set`. [closes #3189] --- lodash.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lodash.js b/lodash.js index 86b22c9b1..d022e6ccb 100644 --- a/lodash.js +++ b/lodash.js @@ -6271,10 +6271,13 @@ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { - length = length == null ? MAX_SAFE_INTEGER : length; + var type = typeof value + length = length == null ? MAX_SAFE_INTEGER : length + return !!length && - (typeof value == 'number' || reIsUint.test(value)) && - (value > -1 && value % 1 == 0 && value < length); + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length) } /**