mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-11 19:25:50 +01:00
Normalise regex -> regexp.
This is what JS uses and using both is confusing.
This commit is contained in:
@@ -511,7 +511,7 @@ const File = Class("File", {
|
||||
|
||||
// expand ~
|
||||
// Yuck.
|
||||
if (!relative && RegExp("~(?:$|[/" + util.escapeRegex(File.PATH_SEP) + "])").test(path)) {
|
||||
if (!relative && RegExp("~(?:$|[/" + util.escapeRegexp(File.PATH_SEP) + "])").test(path)) {
|
||||
// Try $HOME first, on all systems
|
||||
let home = services.get("environment").get("HOME");
|
||||
|
||||
|
||||
@@ -330,7 +330,7 @@ const Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
|
||||
* @param {string} str
|
||||
* @returns {string}
|
||||
*/
|
||||
escapeRegex: function escapeRegex(str) {
|
||||
escapeRegexp: function escapeRegexp(str) {
|
||||
return str.replace(/([\\{}()[\].?*+])/g, "\\$1");
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user