1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-28 02:45:46 +01:00

Fix parsing of invalid JSON strings in arguments, and serialization of strings containing tabs and newlines. Closes issue #72.

This commit is contained in:
Kris Maglione
2010-10-12 17:34:39 -04:00
parent e96c946499
commit 8628551c5a
5 changed files with 18 additions and 13 deletions

View File

@@ -377,9 +377,7 @@ const Option = Class("Option", {
SCOPE_BOTH: 3,
has: {
toggleAll: function toggleAll() toggleAll.supercall(this, "all")
? Array.some(arguments, function (val) this.value.indexOf(val) === -1, this)
: toggleAll.superapply(this, arguments),
toggleAll: function toggleAll() toggleAll.supercall(this, "all") ^ !!toggleAll.superapply(this, arguments),
},
parseRegex: function (value, result, flags) {
@@ -473,7 +471,10 @@ const Option = Class("Option", {
}
return res;
},
quote: function quote(str, re) Commands.quoteArg[/[\s|"'\\,]|^$/.test(str) || re && re.test && re.test(str) ? "'" : ""](str, re),
quote: function quote(str, re)
Commands.quoteArg[/[\s|"'\\,]|^$/.test(str) || re && re.test && re.test(str)
? (/[\b\f\n\r\t]/.test(str) ? '"' : "'")
: ""](str, re),
ops: {
boolean: function (operator, values, scope, invert) {