1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-28 21:42:26 +01:00

Fix arg parsing issue in 38+.

This commit is contained in:
Kris Maglione
2015-05-12 19:40:35 -07:00
parent 48acf656ec
commit fbdae38c9e
2 changed files with 8 additions and 5 deletions

View File

@@ -2099,7 +2099,7 @@ var Buffer = Module("Buffer", {
["y", "<yank-location>"], "Yank current location to the clipboard",
function () {
let { uri } = buffer;
if (uri instanceof Ci.nsIURL)
if (uri instanceof Ci.nsIURL && uri instanceof Ci.nsIMutable && uri.mutable)
uri.query = uri.query.replace(/(?:^|&)utm_[^&]+/g, "")
.replace(/^&/, "");

View File

@@ -1408,14 +1408,17 @@ var Commands = Module("commands", {
if (isString(sep))
sep = RegExp(sep);
sep = sep != null ? sep : /\s/;
sep = (sep != null ? sep : /\s/).source;
if (sep.source == "" || sep.source == "(?:)")
if (sep == "(?:)")
sep = "";
if (sep == "" || sep == "(?:)")
var re1 = /^(?!)/;
else
re1 = RegExp("^" + sep.source);
re1 = RegExp("^" + sep);
let re2 = RegExp(/^()((?:[^\\S"']|\\.)+)((?:\\$)?)/.source.replace("S", sep.source));
let re2 = RegExp(/^()((?:[^\\S"']|\\.)+)((?:\\$)?)/.source.replace("S", sep));
while (str.length && !re1.test(str)) {
let res;