Ensure empty brackets are ignored by _.get and _.set.

This commit is contained in:
jdalton
2015-04-21 00:02:28 -07:00
parent c8314b215b
commit 3429b5d661
2 changed files with 14 additions and 1 deletions

View File

@@ -88,7 +88,7 @@
reInterpolate = /<%=([\s\S]+?)%>/g;
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]+|(["'])(?:(?!\1)[^\n\\]|\\.)*?)\1\]/,
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;