Simplify reIsDeepProp and rePropName.

This commit is contained in:
jdalton
2015-03-29 20:32:25 -07:00
parent 1480abf0e8
commit 0ff96418bd

View File

@@ -88,8 +88,8 @@
reInterpolate = /<%=([\s\S]+?)%>/g; reInterpolate = /<%=([\s\S]+?)%>/g;
/** Used to match property names within property paths. */ /** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:\d+(?:\.\d+)?|(["'])(?:(?!\1)[^\n\\]|\\.)*?)\1\]/, var reIsDeepProp = /\.|\[(?:[^[\]]+|(["'])(?:(?!\1)[^\n\\]|\\.)*?)\1\]/,
rePropName = /([^.[\]]+)|\[(?:(\d+(?:\.\d+)?)|(["'])((?:(?!\3)[^\n\\]|\\.)*?)\3)\]/g; rePropName = /[^.[\]]+|\[(?:(\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
/** /**
* Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special). * Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special).