1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-04-21 06:01:26 +02:00

Don't accept non-boolean options with 'no' prefixes.

This commit is contained in:
Kris Maglione
2011-03-12 15:05:47 -05:00
parent e677acfdd5
commit 45260a2f69
+6 -3
View File
@@ -745,7 +745,7 @@ var Options = Module("options", {
* @param {number} scope Only list options in this scope (see
* {@link Option#scope}).
*/
list: function (filter, scope) {
list: function list(filter, scope) {
if (!scope)
scope = Option.SCOPE_BOTH;
@@ -890,8 +890,11 @@ var Options = Module("options", {
}
if (matches) {
res.option = this.get(res.name, res.scope);
if (!res.option && (res.option = this.get(prefix + res.name, res.scope))) {
if (res.option = this.get(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;
prefix = "";
}