]> git.donarmstrong.com Git - dactyl.git/blobdiff - common/bootstrap.js
Import r6976 from upstream hg supporting Firefox up to 25.*
[dactyl.git] / common / bootstrap.js
index d0dd98a809265f8e95fc3ef420cdb286a89ab02b..4d5dcca634a9e863b5afeebe2ab5fb48e325b6e5 100755 (executable)
@@ -15,7 +15,7 @@ function module(uri) Cu.import(uri, {});
 
 const DEBUG = true;
 
-__defineGetter__("BOOTSTRAP", function () "resource://" + moduleName + "/bootstrap.jsm");
+__defineGetter__("BOOTSTRAP", () => "resource://" + moduleName + "/bootstrap.jsm");
 
 var { AddonManager } = module("resource://gre/modules/AddonManager.jsm");
 var { XPCOMUtils }   = module("resource://gre/modules/XPCOMUtils.jsm");
@@ -37,9 +37,9 @@ function reportError(e) {
     Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService)
                                        .logStringMessage(stack);
 }
-function debug() {
+function debug(...args) {
     if (DEBUG)
-        dump(name + ": " + Array.join(arguments, ", ") + "\n");
+        dump(name + ": " + args.join(", ") + "\n");
 }
 
 function httpGet(uri) {
@@ -103,7 +103,7 @@ let JSMLoader = {
             return resourceProto.resolveURI(uri);
 
         let chan = Services.io.newChannelFromURI(uri);
-        try { chan.cancel(Cr.NS_BINDING_ABORTED) } catch (e) {}
+        try { chan.cancel(Cr.NS_BINDING_ABORTED); } catch (e) {}
         return chan.name;
     },
 
@@ -125,7 +125,7 @@ let JSMLoader = {
     _load: function _load(name, target) {
         let urls = [name];
         if (name.indexOf(":") === -1)
-            urls = this.config["module-paths"].map(function (path) path + name + ".jsm");
+            urls = this.config["module-paths"].map(path => path + name + ".jsm");
 
         for each (let url in urls)
             try {
@@ -224,7 +224,7 @@ function init() {
 
     for each (let line in manifest.split("\n")) {
         let fields = line.split(/\s+/);
-        switch(fields[0]) {
+        switch (fields[0]) {
         case "category":
             categoryManager.addCategoryEntry(fields[1], fields[2], fields[3], false, true);
             categories.push([fields[1], fields[2]]);