From a2fe87a63a61d8bd8705bb9463efcce7d5f4f7ad Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 14 Sep 2015 01:07:12 -0700 Subject: [PATCH] Make regexp var name singular. --- lodash.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lodash.js b/lodash.js index f835e9065..b94f52eee 100644 --- a/lodash.js +++ b/lodash.js @@ -117,11 +117,9 @@ reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g; - /** - * Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). - */ - var reRegExpChars = /[\\^$.*+?()[\]{}|]/g, - reHasRegExpChars = RegExp(reRegExpChars.source); + /** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); /** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */ var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g; @@ -1319,7 +1317,7 @@ /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + - fnToString.call(hasOwnProperty).replace(reRegExpChars, '\\$&') + fnToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); @@ -10418,8 +10416,8 @@ */ function escapeRegExp(string) { string = baseToString(string); - return (string && reHasRegExpChars.test(string)) - ? string.replace(reRegExpChars, '\\$&') + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') : string; }