mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-22 09:25:45 +01:00
Don't accept non-boolean options with 'no' prefixes.
This commit is contained in:
@@ -745,7 +745,7 @@ var Options = Module("options", {
|
|||||||
* @param {number} scope Only list options in this scope (see
|
* @param {number} scope Only list options in this scope (see
|
||||||
* {@link Option#scope}).
|
* {@link Option#scope}).
|
||||||
*/
|
*/
|
||||||
list: function (filter, scope) {
|
list: function list(filter, scope) {
|
||||||
if (!scope)
|
if (!scope)
|
||||||
scope = Option.SCOPE_BOTH;
|
scope = Option.SCOPE_BOTH;
|
||||||
|
|
||||||
@@ -890,8 +890,11 @@ var Options = Module("options", {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (matches) {
|
if (matches) {
|
||||||
res.option = this.get(res.name, res.scope);
|
if (res.option = this.get(res.name, res.scope)) {
|
||||||
if (!res.option && (res.option = this.get(prefix + res.name, res.scope))) {
|
if (prefix === "no" && res.option.type !== "boolean")
|
||||||
|
res.option = null;
|
||||||
|
}
|
||||||
|
else if (res.option = this.get(prefix + res.name, res.scope)) {
|
||||||
res.name = prefix + res.name;
|
res.name = prefix + res.name;
|
||||||
prefix = "";
|
prefix = "";
|
||||||
}
|
}
|
||||||
@@ -988,7 +991,7 @@ var Options = Module("options", {
|
|||||||
let names = set(list.map(function (opt) opt.option ? opt.option.name : ""));
|
let names = set(list.map(function (opt) opt.option ? opt.option.name : ""));
|
||||||
if (list.length)
|
if (list.length)
|
||||||
if (list.some(function (opt) opt.all))
|
if (list.some(function (opt) opt.all))
|
||||||
options.list(function (opt) !(list[0].onlyNonDefault && opt.isDefault) , list[0].scope);
|
options.list(function (opt) !(list[0].onlyNonDefault && opt.isDefault), list[0].scope);
|
||||||
else
|
else
|
||||||
options.list(function (opt) set.has(names, opt.name), list[0].scope);
|
options.list(function (opt) set.has(names, opt.name), list[0].scope);
|
||||||
list = [];
|
list = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user