mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-05 13:14:11 +01:00
Fix use of String#replace flags parameter.
It is deprecated. See https://bugzil.la/1142351.
This commit is contained in:
@@ -459,7 +459,7 @@ var Modes = Module("modes", {
|
|||||||
|
|
||||||
get count() !this.insert,
|
get count() !this.insert,
|
||||||
|
|
||||||
_display: Class.Memoize(function _display() this.name.replace("_", " ", "g")),
|
_display: Class.Memoize(function _display() this.name.replace(/_/g, " ")),
|
||||||
|
|
||||||
display: function display() this._display,
|
display: function display() this._display,
|
||||||
|
|
||||||
|
|||||||
@@ -1431,7 +1431,7 @@ var Commands = Module("commands", {
|
|||||||
else if ((res = /^(")((?:[^\\"]|\\.)*)("?)/.exec(str)))
|
else if ((res = /^(")((?:[^\\"]|\\.)*)("?)/.exec(str)))
|
||||||
arg += keepQuotes ? res[0] : JSON.parse(fixEscapes(res[0]) + (res[3] ? "" : '"'));
|
arg += keepQuotes ? res[0] : JSON.parse(fixEscapes(res[0]) + (res[3] ? "" : '"'));
|
||||||
else if ((res = /^(')((?:[^']|'')*)('?)/.exec(str)))
|
else if ((res = /^(')((?:[^']|'')*)('?)/.exec(str)))
|
||||||
arg += keepQuotes ? res[0] : res[2].replace("''", "'", "g");
|
arg += keepQuotes ? res[0] : res[2].replace(/''/g, "'");
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -741,7 +741,7 @@ var File = Class("File", {
|
|||||||
path = OS.Path.join(OS.Constants.Path.homeDir,
|
path = OS.Path.join(OS.Constants.Path.homeDir,
|
||||||
path.substr(2));
|
path.substr(2));
|
||||||
|
|
||||||
return OS.Path.normalize(path.replace("/", File.PATH_SEP, "g"));
|
return OS.Path.normalize(path.replace(/\//g, File.PATH_SEP));
|
||||||
},
|
},
|
||||||
|
|
||||||
expandPathList: function (list) list.map(this.expandPath),
|
expandPathList: function (list) list.map(this.expandPath),
|
||||||
|
|||||||
@@ -608,7 +608,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
escapeString: function escapeString(str, delimiter) {
|
escapeString: function escapeString(str, delimiter) {
|
||||||
if (delimiter == undefined)
|
if (delimiter == undefined)
|
||||||
delimiter = '"';
|
delimiter = '"';
|
||||||
return delimiter + str.replace(/([\\'"])/g, "\\$1").replace("\n", "\\n", "g").replace("\t", "\\t", "g") + delimiter;
|
return delimiter + str.replace(/([\\'"])/g, "\\$1").replace(/\n/g, "\\n").replace(/\t/g, "\\t") + delimiter;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user