]> git.donarmstrong.com Git - dactyl.git/blobdiff - common/modules/addons.jsm
Import r6948 from upstream hg supporting Firefox up to 24.*
[dactyl.git] / common / modules / addons.jsm
index 2e52a9aaee7f888675b430c852032b193e5f2df5..e2c577ad9f704a611207314cf97ffd40881e112b 100644 (file)
@@ -15,8 +15,7 @@ defineModule("addons", {
 this.lazyRequire("completion", ["completion"]);
 lazyRequire("template", ["template"]);
 
-var callResult = function callResult(method) {
-    let args = Array.slice(arguments, 1);
+var callResult = function callResult(method, ...args) {
     return function (result) { result[method].apply(result, args); };
 }
 
@@ -25,7 +24,7 @@ var listener = function listener(action, event)
         this.dactyl[install.error ? "echoerr" : "echomsg"](
             _("addon.error", action, event, (install.name || install.sourceURI.spec) +
                 (install.error ? ": " + addons.errors[install.error] : "")));
-    }
+    };
 
 var AddonListener = Class("AddonListener", {
     init: function init(modules) {
@@ -120,7 +119,7 @@ var actions = {
         },
         get filter() {
             return function (addon) !addon.userDisabled &&
-                !(addon.operationsRequiringRestart & (AddonManager.OP_NEEDS_RESTART_ENABLE | AddonManager.OP_NEEDS_RESTART_DISABLE))
+                !(addon.operationsRequiringRestart & (AddonManager.OP_NEEDS_RESTART_ENABLE | AddonManager.OP_NEEDS_RESTART_DISABLE));
         },
         perm: "disable"
     },
@@ -206,14 +205,13 @@ var Addon = Class("Addon", {
                     ["span", { highlight: pending[0] }, pending[1]],
                     " on ",
                     ["a", { href: "#", "dactyl:command": "dactyl.restart" }, "restart"],
-                    ")"]
+                    ")"];
         return info;
     },
 
     update: function callee() {
-        let self = this;
-        function update(key, xml) {
-            let node = self.nodes[key];
+        let update = (key, xml) => {
+            let node = this.nodes[key];
             while (node.firstChild)
                 node.removeChild(node.firstChild);
 
@@ -390,9 +388,9 @@ var Addons = Module("addons", {
                 }
 
                 if (!file.exists())
-                    AddonManager.getInstallForURL(url,   install, "application/x-xpinstall");
+                    AddonManager.getInstallForURL(url,        install, "application/x-xpinstall");
                 else if (file.isReadable() && file.isFile())
-                    AddonManager.getInstallForFile(file, install, "application/x-xpinstall");
+                    AddonManager.getInstallForFile(file.file, install, "application/x-xpinstall");
                 else if (file.isDirectory())
                     dactyl.echoerr(_("addon.cantInstallDir", file.path.quote()));
                 else
@@ -498,4 +496,4 @@ endModule();
 
 } catch(e){ if (isString(e)) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
 
-// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
+// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript: