diff --git a/common/content/javascript.js b/common/content/javascript.js index d8bc0a0d..e7a12ae5 100644 --- a/common/content/javascript.js +++ b/common/content/javascript.js @@ -58,13 +58,13 @@ const JavaScript = Module("javascript", { objectKeys: function objectKeys(obj, toplevel) { // Things we can dereference - if (!obj || ["object", "string", "function"].indexOf(typeof obj) == -1) + if (!obj || ["object", "string", "function"].indexOf(typeof obj) === -1) return []; if (jsmodules.isPrototypeOf(obj) && !toplevel) return []; let completions = [k for (k in this.iter(obj, toplevel))]; - if (obj == modules) // Hack. + if (obj === modules) // Hack. completions = completions.concat([k for (k in this.iter(jsmodules, toplevel))]); return completions; }, diff --git a/common/content/options.js b/common/content/options.js index 926c6b97..7b1e5b31 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -393,7 +393,7 @@ const Option = Class("Option", { return re; }, unparseRegexp: function (re) re.bang + Option.quote(re.source.replace(/\\(.)/g, function (m, n1) n1 == "/" ? n1 : m), /^!|:/) + - (typeof re.result === "string" ? ":" + Option.quote(re.result) : ""), + (typeof re.result === "boolean" ? "" : ":" + Option.quote(re.result)), getKey: { stringlist: function (k) this.value.indexOf(k) >= 0, @@ -725,8 +725,10 @@ const Options = Module("options", { if (opt.type == "boolean") { if (!opt.value) option.pre = "no"; - option.default = (option.default ? "" : "no") + opt.name; + option.default = (opt.defaultValue ? "" : "no") + opt.name; } + else if (isArray(opt.value)) + option.value = <>={template.map(opt.value, function (v) template.highlight(String(v)), <>, )}; else option.value = <>={template.highlight(opt.stringValue)}; yield option;