diff --git a/lodash.src.js b/lodash.src.js index a571c0d69..ec9454ef4 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -89,6 +89,7 @@ /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]+|(["'])(?:(?!\1)[^\n\\]|\\.)*?)\1\]/, + reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g; /** @@ -4330,6 +4331,10 @@ * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { + var type = typeof value; + if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { + return true; + } if (isArray(value)) { return false; }