mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-06 05:05:45 +01:00
Add tests for dead help links. Fix some minor bugs. Show error when trying to modify a builtin group rather than failing silently.
This commit is contained in:
@@ -229,9 +229,9 @@ var Addon = Class("Addon", {
|
||||
if (node.update && node.update !== callee)
|
||||
node.update();
|
||||
|
||||
let event = this.document.createEvent("Events");
|
||||
let event = this.list.document.createEvent("Events");
|
||||
event.initEvent("dactyl-commandupdate", true, false);
|
||||
this.document.dispatchEvent(event);
|
||||
this.list.document.dispatchEvent(event);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -261,9 +261,9 @@ var AddonList = Class("AddonList", {
|
||||
this.ready = false;
|
||||
|
||||
AddonManager.getAddonsByTypes(types, this.closure(function (addons) {
|
||||
addons.forEach(this.closure.addAddon);
|
||||
this.ready = true;
|
||||
this.update();
|
||||
this._addons = addons;
|
||||
if (this.document)
|
||||
this._init();
|
||||
}));
|
||||
AddonManager.addAddonListener(this);
|
||||
},
|
||||
@@ -271,6 +271,12 @@ var AddonList = Class("AddonList", {
|
||||
AddonManager.removeAddonListener(this);
|
||||
},
|
||||
|
||||
_init: function _init() {
|
||||
this._addons.forEach(this.closure.addAddon);
|
||||
this.ready = true;
|
||||
this.update();
|
||||
},
|
||||
|
||||
message: Class.memoize(function () {
|
||||
|
||||
XML.ignoreWhitespace = true;
|
||||
@@ -284,6 +290,9 @@ var AddonList = Class("AddonList", {
|
||||
</tr>
|
||||
</table>, this.document, this.nodes);
|
||||
|
||||
if (this._addons)
|
||||
this._init();
|
||||
|
||||
return this.nodes.list;
|
||||
}),
|
||||
|
||||
|
||||
@@ -463,6 +463,11 @@ var Contexts = Module("contexts", {
|
||||
|
||||
if (args.context)
|
||||
args.context.group = group;
|
||||
|
||||
util.assert(!group.builtin ||
|
||||
!["-description", "-locations", "-nopersist"]
|
||||
.some(function (arg) set.has(args.explicitOpts, arg)),
|
||||
"Cannot modify builtin group");
|
||||
},
|
||||
{
|
||||
argCount: "?",
|
||||
|
||||
@@ -73,8 +73,10 @@ var JavaScript = Module("javascript", {
|
||||
|
||||
let seen = isinstance(obj, ["Sandbox"]) ? set(JavaScript.magicalNames) : {};
|
||||
let globals = values(toplevel && this.window === obj ? this.globalNames : []);
|
||||
if (toplevel && "wrappedJSObject" in obj)
|
||||
|
||||
if (toplevel && isObject(obj) && "wrappedJSObject" in obj)
|
||||
yield "wrappedJSObject";
|
||||
|
||||
for (let key in iter(globals, properties(obj, !toplevel, true)))
|
||||
if (!set.add(seen, key))
|
||||
yield key;
|
||||
|
||||
Reference in New Issue
Block a user