diff --git a/lib/util.js b/lib/util.js index 75390bd1..bab8a0ff 100644 --- a/lib/util.js +++ b/lib/util.js @@ -529,14 +529,13 @@ return conv; }; - this.escapeRegExp = function(pStr) { - var ret = pStr, - isStr = Util.isString(pStr); + this.escapeRegExp = function(str) { + var isStr = Util.isString(str); if (isStr) - ret = pStr.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); + str = str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); - return ret; + return str; }; /**