[Pkg-mozext-commits] [tabmixplus] 17/147: Apply Eslint 'prefer-arrow-callback' rule

David Prévot taffit at moszumanska.debian.org
Sat Aug 5 15:27:32 UTC 2017


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository tabmixplus.

commit 5076f3d609b196885a4332b42b752868abf948aa
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sun Oct 30 09:38:03 2016 +0200

    Apply Eslint 'prefer-arrow-callback' rule
---
 .eslintrc.js                              |  2 +-
 chrome/content/click/click.js             |  2 +-
 chrome/content/extensions/extensions.js   |  8 ++++----
 chrome/content/flst/lasttab.js            |  2 +-
 chrome/content/links/contentLinks.js      |  2 +-
 chrome/content/minit/tabView.js           |  8 ++++----
 chrome/content/minit/tablib.js            |  8 ++++----
 chrome/content/overlay/removeBlankTab.js  |  2 +-
 chrome/content/places/places.js           |  2 +-
 chrome/content/preferences/preferences.js | 14 +++++++-------
 chrome/content/preferences/shortcuts.js   |  2 +-
 chrome/content/session/session.js         |  8 ++++----
 chrome/content/session/sessionStore.js    | 14 +++++++-------
 chrome/content/tab/scrollbox.xml          |  7 +++----
 chrome/content/tab/tab.js                 | 18 +++++++++---------
 chrome/content/tabmix.js                  |  4 ++--
 chrome/content/utils.js                   |  2 +-
 modules/AboutNewTab.jsm                   |  2 +-
 modules/AutoReload.jsm                    |  2 +-
 modules/ContentClick.jsm                  | 14 +++++++-------
 modules/DynamicRules.jsm                  |  8 ++++----
 modules/MergeWindows.jsm                  |  2 +-
 modules/Places.jsm                        |  8 ++++----
 modules/Services.jsm                      | 28 ++++++++++++++--------------
 modules/Shortcuts.jsm                     |  4 ++--
 modules/Slideshow.jsm                     |  2 +-
 modules/TabGroupsMigrator.jsm             |  4 ++--
 modules/extensions/AddonManager.jsm       |  6 +++---
 modules/extensions/CompatibilityCheck.jsm |  6 +++---
 modules/log.jsm                           |  4 ++--
 30 files changed, 97 insertions(+), 98 deletions(-)

diff --git a/.eslintrc.js b/.eslintrc.js
index 77dfa7d..7cf2a77 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -226,7 +226,7 @@ module.exports = {
     "operator-assignment": [2, "always"],
     "operator-linebreak": [2, "after"],
     "padded-blocks": [2, "never"],
-    "prefer-arrow-callback": 0, // TODO many errors in old code
+    "prefer-arrow-callback": [2, {"allowNamedFunctions": true}],
     "prefer-const": 0,  // TODO many errors in old code
     "prefer-numeric-literals": 0,
     "prefer-rest-params": 0, // I don’t want to be notified about arguments variables,
diff --git a/chrome/content/click/click.js b/chrome/content/click/click.js
index f6ba97f..ef803c4 100644
--- a/chrome/content/click/click.js
+++ b/chrome/content/click/click.js
@@ -867,7 +867,7 @@ var TabmixAllTabs = {
   // show sort/unsort tabs list popup after click on sorted tab menu
   showTabsListPopup: function TMP_showTabsListPopup(event) {
     event.stopPropagation();
-    setTimeout(function(popup) {
+    setTimeout(popup => {
       popup.showPopup(popup.parentNode, -1, -1, "popup", "bottomleft", "topleft");
     }, 0, event.target.parentNode);
   },
diff --git a/chrome/content/extensions/extensions.js b/chrome/content/extensions/extensions.js
index 3ed9b6e..1fca23a 100644
--- a/chrome/content/extensions/extensions.js
+++ b/chrome/content/extensions/extensions.js
@@ -37,7 +37,7 @@ var TMP_extensionsCompatibility = {
     }
 
     // sessionManager extension is restartless since version 0.8
-    Tabmix.extensions.__defineGetter__("sessionManager", function() {
+    Tabmix.extensions.__defineGetter__("sessionManager", () => {
       return TabmixSvc.sessionManagerAddonInstalled ||
         "com" in window && com.morac &&
         typeof com.morac.SessionManagerAddon == "object";
@@ -63,7 +63,7 @@ var TMP_extensionsCompatibility = {
       document.getElementById("main-window").setAttribute("gscltTMPinstalled", true);
       let func = ["_setupForOtherExtensions", "enableCustomDragDropMode"];
       let GlaxChrome = window.GlaxChrome.CLT.DragDropManager;
-      func.forEach(function(aFn) {
+      func.forEach(aFn => {
         if (aFn in GlaxChrome) {
           Tabmix.changeCode(GlaxChrome, "GlaxChrome.CLT.DragDropManager." + aFn)._replace(
             '{', '{var TabDNDObserver = TMP_tabDNDObserver;',
@@ -91,7 +91,7 @@ var TMP_extensionsCompatibility = {
     if ("SecondSearchBrowser" in window && SecondSearchBrowser.prototype) {
       let func = ["canOpenNewTab", "loadForSearch", "checkToDoSearch"];
       let SSB = SecondSearchBrowser.prototype;
-      func.forEach(function(aFn) {
+      func.forEach(aFn => {
         if (aFn in SSB && SSB[aFn].toString().indexOf("TM_init") != -1) {
           Tabmix.changeCode(SSB, "SecondSearchBrowser.prototype." + aFn)._replace(
             'TM_init', 'Tabmix.startup'
@@ -542,7 +542,7 @@ TMP_extensionsCompatibility.wizzrss = {
       "doSearch", "viewLog", "renderItem", "playEnc", "renderAllEnc", "playAllEnc",
       "gotoLink", "itemLinkClick", "itemListClick"];
 
-    _functions.forEach(function(_function) {
+    _functions.forEach(_function => {
       if (_function in window)
         Tabmix.changeCode(window, _function)._replace(codeToReplace, newCode).toCode();
     });
diff --git a/chrome/content/flst/lasttab.js b/chrome/content/flst/lasttab.js
index fd4f682..a47c6a7 100644
--- a/chrome/content/flst/lasttab.js
+++ b/chrome/content/flst/lasttab.js
@@ -206,7 +206,7 @@ var TMP_LastTab = {
     if (this._tabs)
       return this._tabs;
     let list = this.handleCtrlTab ? this.TabHistory : gBrowser.tabs;
-    this._tabs = Array.prototype.filter.call(list, function(tab) {
+    this._tabs = Array.prototype.filter.call(list, tab => {
       return !tab.hidden && !tab.closing;
     });
     return this._tabs;
diff --git a/chrome/content/links/contentLinks.js b/chrome/content/links/contentLinks.js
index 889fbf6..f5899a3 100644
--- a/chrome/content/links/contentLinks.js
+++ b/chrome/content/links/contentLinks.js
@@ -4,7 +4,7 @@ Tabmix.contentAreaClick = {
   init: function() {
     // this getter trigger by call to isGreasemonkeyInstalled from
     // TMP_extensionsCompatibility.onDelayedStartup
-    XPCOMUtils.defineLazyGetter(Tabmix, "ContentClick", function() {
+    XPCOMUtils.defineLazyGetter(Tabmix, "ContentClick", () => {
       let tmp = {};
       Cu.import("resource://tabmixplus/ContentClick.jsm", tmp);
       return tmp.TabmixContentClick;
diff --git a/chrome/content/minit/tabView.js b/chrome/content/minit/tabView.js
index e9629a0..4ca1436 100644
--- a/chrome/content/minit/tabView.js
+++ b/chrome/content/minit/tabView.js
@@ -16,7 +16,7 @@
       case "TabShow":
         if (!gBrowser.tabContainer._onDelayTabShow) {
           // pass aEvent to this function for use in TGM
-          gBrowser.tabContainer._onDelayTabShow = window.setTimeout(function(event) {
+          gBrowser.tabContainer._onDelayTabShow = window.setTimeout(event => {
             gBrowser.tabContainer._onDelayTabShow = null;
             TMP_eventListener.onTabOpen_delayUpdateTabBar(event.target);
           }, 0, aEvent);
@@ -25,7 +25,7 @@
       case "TabHide":
         if (!gBrowser.tabContainer._onDelayTabHide) {
           // pass aEvent to this function for use in TGM
-          gBrowser.tabContainer._onDelayTabHide = window.setTimeout(function(event) {
+          gBrowser.tabContainer._onDelayTabHide = window.setTimeout(event => {
             gBrowser.tabContainer._onDelayTabHide = null;
             let tab = event.target;
             TMP_eventListener.onTabClose_updateTabBar(tab);
@@ -360,7 +360,7 @@
     if (!excludeTabs)
       excludeTabs = [];
 
-    return !Array.prototype.some.call(gBrowser.tabs, function(tab) {
+    return !Array.prototype.some.call(gBrowser.tabs, tab => {
       return !tab.pinned && !tab.hidden && !tab.closing &&
           excludeTabs.indexOf(tab) == -1;
     });
@@ -398,7 +398,7 @@
     let keys = Object.keys(aGroupItems);
     if (!aGroupsData.nextID) {
       let nextID = 0;
-      keys.forEach(function(key) {
+      keys.forEach(key => {
         nextID = Math.max(aGroupItems[key].id, nextID);
       });
       aGroupsData.nextID = nextID++;
diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index 70dd4da..68d9583 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -132,7 +132,7 @@ var tablib = { // eslint-disable-line
       tabGroups: "paneSession.clearData",
     };
     let keys = Object.keys(exceptionList);
-    let isInstalled = keys.some(function(item) {
+    let isInstalled = keys.some(item => {
       return typeof window[item] == "object";
     });
     if (!isInstalled)
@@ -932,7 +932,7 @@ var tablib = { // eslint-disable-line
     clearList.id = "menu_clearClosedWindowsList";
     clearList.setAttribute("label", TabmixSvc.getString("undoClosedWindows.clear.label"));
     clearList.setAttribute("value", -1);
-    clearList.addEventListener("command", function() {
+    clearList.addEventListener("command", () => {
       TabmixSessionManager.forgetClosedWindow(-1);
     });
     undoPopup.insertBefore(clearList, restoreAllWindows);
@@ -1442,7 +1442,7 @@ var tablib = { // eslint-disable-line
           return currentIndex == l - 1 ? currentIndex - 1 : l - 1;
         case 6: {// last opened
           let lastTabIndex, maxID = -1;
-          tabs.forEach(function(tab, index) {
+          tabs.forEach((tab, index) => {
             if (tab == oldTab)
               return;
             let linkedPanel = tab.linkedPanel.replace('panel', '');
@@ -1775,7 +1775,7 @@ var tablib = { // eslint-disable-line
     // Not in use since Firefox 27, see comment in TabmixTabClickOptions
     if (Tabmix.prefs.getBoolPref("tabbar.click_dragwindow") &&
         TabmixTabClickOptions._blockDblClick) {
-      setTimeout(function() {
+      setTimeout(() => {
         TabmixTabClickOptions._blockDblClick = false;
         if (!Tabmix.isVersion(270))
           gBrowser.tabContainer._blockDblClick = false;
diff --git a/chrome/content/overlay/removeBlankTab.js b/chrome/content/overlay/removeBlankTab.js
index fbb824c..3dd5077 100644
--- a/chrome/content/overlay/removeBlankTab.js
+++ b/chrome/content/overlay/removeBlankTab.js
@@ -92,7 +92,7 @@ var TabmixRemoveBlankTab = {
     window.addEventListener("unload", function _unload(aEvent) {
       aEvent.currentTarget.removeEventListener("unload", _unload, false);
       if (win && !win.closed) {
-        win.setTimeout(function() {
+        win.setTimeout(() => {
           let tabBrowser = win && win.gBrowser;
           if (!tabBrowser || !tab || !tab.parentNode) {
             return;
diff --git a/chrome/content/places/places.js b/chrome/content/places/places.js
index 0f57573..5005733 100644
--- a/chrome/content/places/places.js
+++ b/chrome/content/places/places.js
@@ -768,7 +768,7 @@ Tabmix.onContentLoaded = {
   getXnotifierFunction: function(aName) {
     let com = window.com;
     if (typeof com == "object" && typeof com.tobwithu == "object") {
-      let fn = ["wmn", "xnotifier"].filter(function(f) {
+      let fn = ["wmn", "xnotifier"].filter(f => {
         return typeof com.tobwithu[f] == "object" &&
           typeof com.tobwithu[f][aName] == "function";
       });
diff --git a/chrome/content/preferences/preferences.js b/chrome/content/preferences/preferences.js
index 6581f27..c1a397b 100644
--- a/chrome/content/preferences/preferences.js
+++ b/chrome/content/preferences/preferences.js
@@ -349,7 +349,7 @@ var sessionPrefs = ["browser.sessionstore.resume_from_crash",
   "extensions.tabmix.sessions.manager",
   "extensions.tabmix.sessions.crashRecovery"];
 
-XPCOMUtils.defineLazyGetter(window, "gPreferenceList", function() {
+XPCOMUtils.defineLazyGetter(window, "gPreferenceList", () => {
   // other settings not in extensions.tabmix. branch that we save
   let otherPrefs = [
     "browser.allTabs.previews", "browser.ctrlTab.previews",
@@ -371,7 +371,7 @@ XPCOMUtils.defineLazyGetter(window, "gPreferenceList", function() {
   let prefs = Services.prefs.getDefaultBranch("");
   let tabmixPrefs = Services.prefs.getChildList("extensions.tabmix.").sort();
   // filter out preference without default value
-  tabmixPrefs = otherPrefs.concat(tabmixPrefs).filter(function(pref) {
+  tabmixPrefs = otherPrefs.concat(tabmixPrefs).filter(pref => {
     try {
       return prefs["get" + PrefFn[prefs.getPrefType(pref)]](pref) !== undefined;
     } catch (ex) { }
@@ -380,7 +380,7 @@ XPCOMUtils.defineLazyGetter(window, "gPreferenceList", function() {
   return tabmixPrefs;
 });
 
-XPCOMUtils.defineLazyGetter(this, "_sminstalled", function() {
+XPCOMUtils.defineLazyGetter(this, "_sminstalled", () => {
   return Tabmix.getTopWin().Tabmix.extensions.sessionManager;
 });
 
@@ -392,7 +392,7 @@ function defaultSetting() {
   let SMinstalled = _sminstalled;
   let prefs = !SMinstalled ? gPreferenceList :
       gPreferenceList.map(pref => sessionPrefs.indexOf(pref) == -1);
-  prefs.forEach(function(pref) {
+  prefs.forEach(pref => {
     Services.prefs.clearUserPref(pref);
   });
   // we enable our session manager on default
@@ -409,7 +409,7 @@ function toggleSyncPreference() {
   let fn = Tabmix.prefs.getBoolPref("syncPrefs") ? "clearUserPref" : "setBoolPref";
   Tabmix.prefs[fn]("syncPrefs", true);
   let exclude = ["extensions.tabmix.sessions.onStart.sessionpath"];
-  gPreferenceList.forEach(function(pref) {
+  gPreferenceList.forEach(pref => {
     if (exclude.indexOf(pref) == -1)
       Services.prefs[fn](sync + pref, true);
   });
@@ -421,7 +421,7 @@ function exportData() {
   gPrefWindow.onApply();
   showFilePicker("save").then(file => {
     if (file) {
-      let patterns = gPreferenceList.map(function(pref) {
+      let patterns = gPreferenceList.map(pref => {
         return "\n" + pref + "=" + getPrefByType(pref);
       });
       patterns.unshift("tabmixplus");
@@ -601,7 +601,7 @@ window.gIncompatiblePane = {
 
 };
 
-XPCOMUtils.defineLazyGetter(gPrefWindow, "pinTabLabel", function() {
+XPCOMUtils.defineLazyGetter(gPrefWindow, "pinTabLabel", () => {
   let win = Tabmix.getTopWin();
   return win.document.getElementById("context_pinTab").getAttribute("label") + "/" +
          win.document.getElementById("context_unpinTab").getAttribute("label");
diff --git a/chrome/content/preferences/shortcuts.js b/chrome/content/preferences/shortcuts.js
index 9599d8a..88a4c7a 100644
--- a/chrome/content/preferences/shortcuts.js
+++ b/chrome/content/preferences/shortcuts.js
@@ -21,7 +21,7 @@ function getKeysForShortcut(shortcut, id, win) {
 
   let dots = "…";
   let keys = win.document.getElementsByTagName("key");
-  let usedKeys = Array.prototype.filter.call(keys, function(key) {
+  let usedKeys = Array.prototype.filter.call(keys, key => {
     if (ourKey == key)
       return false;
     if (isDisabled(key) || isDisabled($(key.getAttribute("command"))))
diff --git a/chrome/content/session/session.js b/chrome/content/session/session.js
index 883da8d..00f2e89 100644
--- a/chrome/content/session/session.js
+++ b/chrome/content/session/session.js
@@ -133,7 +133,7 @@ TabmixSessionData = {
       tabProperties += "11111";
     else {
       let disallow = Tabmix.docShellCapabilities.collect(aTab);
-      this.docShellItems.forEach(function(item) {
+      this.docShellItems.forEach(item => {
         tabProperties += disallow.indexOf(item) != -1 ? "0" : "1";
       });
     }
@@ -857,7 +857,7 @@ TabmixSessionManager = {
           TabmixSvc.getSMString("sm.corrupted.msg1");
       var buttons = ["", TabmixSvc.setLabel("sm.button.continue")].join("\n");
       this.promptService([Tabmix.BUTTON_CANCEL, Tabmix.HIDE_MENUANDTEXT, Tabmix.HIDE_CHECKBOX],
-                         [title, msg, "", "", buttons], window, function() {});
+                         [title, msg, "", "", buttons], window, () => {});
       Tabmix.assert(e);
       file.moveTo(this.profileDir, "session.old");
       this.DATASource = this.RDFService.GetDataSourceBlocking(uri);
@@ -2482,7 +2482,7 @@ TabmixSessionManager = {
     if (!win._closedTabs)
       win._closedTabs = [];
     // Move tabs to first window
-    state.windows.forEach(function(aWindow) {
+    state.windows.forEach(aWindow => {
       win.tabs = win.tabs.concat(aWindow.tabs);
       if (aWindow._closedTabs)
         win._closedTabs = win._closedTabs.concat(aWindow._closedTabs);
@@ -3513,7 +3513,7 @@ TabmixSessionManager = {
     if (aTab != gBrowser.mCurrentTab)
       attributes = attributes.concat(["visited", "tabmix_selectedID"]);
 
-    attributes.forEach(function(attrib) {
+    attributes.forEach(attrib => {
       if (aTab.hasAttribute(attrib))
         aTab.removeAttribute(attrib);
     });
diff --git a/chrome/content/session/sessionStore.js b/chrome/content/session/sessionStore.js
index 6a1f30b..7e7a7e0 100644
--- a/chrome/content/session/sessionStore.js
+++ b/chrome/content/session/sessionStore.js
@@ -75,7 +75,7 @@ var TMP_SessionStore = {
       if ("TreeStyleTabBrowser" in window)
         _xulAttributes = _xulAttributes.concat(TabmixSessionData.tabTSTProperties);
 
-      _xulAttributes.forEach(function(aAttr) {
+      _xulAttributes.forEach(aAttr => {
         TabmixSvc.ss.persistTabAttribute(aAttr);
       });
 
@@ -218,11 +218,11 @@ var TMP_SessionStore = {
       // calling doRestore before sessionstartup finished to read
       // sessionStore.js file throw error since Firefox 28, and force
       // syncRead in Firefox 25-27
-      XPCOMUtils.defineLazyGetter(Tabmix, "isWindowAfterSessionRestore", function() {
+      XPCOMUtils.defineLazyGetter(Tabmix, "isWindowAfterSessionRestore", () => {
         let ss = Cc["@mozilla.org/browser/sessionstartup;1"]
                    .getService(Ci.nsISessionStartup);
         // when TMP session manager is enabled ss.doRestore is true only after restart
-        ss.onceInitialized.then(function() {
+        ss.onceInitialized.then(() => {
           Tabmix.isWindowAfterSessionRestore = ss.doRestore();
         }).then(null, Tabmix.reportError);
         // until sessionstartup initialized just return the pref value,
@@ -677,7 +677,7 @@ var TabmixConvertSession = {
     TabmixSessionManager.saveStateDelayed();
     var callBack = function(aResult) {
       if (aResult.button == Tabmix.BUTTON_OK) {
-        setTimeout(function(a, b) {
+        setTimeout((a, b) => {
           TabmixConvertSession.convertFile(a, b);
         }, 50, null, true);
       }
@@ -798,7 +798,7 @@ var TabmixConvertSession = {
         tabsData.push(new _tabData(rdfNodeTab));
       }
     }
-    tabsData.sort(function(a, b) {
+    tabsData.sort((a, b) => {
       return a - b;
     });
     for (let i = 0; i < tabsData.length; i++) {
@@ -875,13 +875,13 @@ var TabmixConvertSession = {
       let TSTProps = properties.split('|');
       properties = TSTProps.shift();
       let PREFIX = "tmp-session-data-";
-      TSTProps.forEach(function(aProp) {
+      TSTProps.forEach(aProp => {
         if (/^([^\s=]+)=(.*)/.test(aProp) &&
             RegExp.$1.startsWith(PREFIX) && RegExp.$2)
           extData[RegExp.$1.substr(PREFIX.length)] = decodeURIComponent(RegExp.$2);
       });
       properties = properties.substr(booleanAttrLength + 1).split(" ");
-      properties.forEach(function(aAttr) {
+      properties.forEach(aAttr => {
         aAttr = TabmixSessionManager.getDecodedLiteralValue(null, aAttr);
         if (!/^([^\s=]+)=(.*)/.test(aAttr))
           return;
diff --git a/chrome/content/tab/scrollbox.xml b/chrome/content/tab/scrollbox.xml
index 5c69718..8c038a4 100644
--- a/chrome/content/tab/scrollbox.xml
+++ b/chrome/content/tab/scrollbox.xml
@@ -543,10 +543,9 @@
             this.__needToSetVerticalOrient = true;
             // when widthFitTitle is false we enter vertical mode only after we are in overflow
             // if first or last tab is not visible enter vertical mode
-            var self = this;
-            this._enterVerticalModeTimeout = setTimeout(function() {
-              self._enterVerticalModeTimeout = null;
-              self._enterVerticalMode(true);
+            this._enterVerticalModeTimeout = setTimeout(() => {
+              this._enterVerticalModeTimeout = null;
+              this._enterVerticalMode(true);
             }, 25);
             return;
           }
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index a82539b..abd50d5 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -571,7 +571,7 @@ var TabmixTabbar = {
 
 }; // TabmixTabbar end
 
-XPCOMUtils.defineLazyGetter(TabmixTabbar, "updateAppearanceOnce", function() {
+XPCOMUtils.defineLazyGetter(TabmixTabbar, "updateAppearanceOnce", () => {
   return navigator.oscpu.startsWith("Windows NT 5.1");
 });
 
@@ -618,10 +618,10 @@ Tabmix.tabsUtils = {
     var tabbrowser = this.tabBar.tabbrowser;
     let tab = this.tabBar.firstChild;
 
-    XPCOMUtils.defineLazyGetter(Tabmix, "rtl", function() {
+    XPCOMUtils.defineLazyGetter(Tabmix, "rtl", () => {
       return window.getComputedStyle(tabbrowser, null).direction == "rtl";
     });
-    XPCOMUtils.defineLazyGetter(Tabmix, "ltr", function() {
+    XPCOMUtils.defineLazyGetter(Tabmix, "ltr", () => {
       return !Tabmix.rtl;
     });
 
@@ -649,7 +649,7 @@ Tabmix.tabsUtils = {
     this._show_newtabbutton = "aftertabs";
 
     let attr = ["notpinned", "autoreload", "protected",
-      "locked"].filter(function(att) {
+      "locked"].filter(att => {
         return Tabmix.prefs.getBoolPref("extraIcons." + att);
       });
     if (attr.length)
@@ -833,10 +833,10 @@ Tabmix.tabsUtils = {
             if (timeFromLastTabOpened < 250)
               timeout = 0;
           }
-          this.adjustNewtabButtonTimeout = setTimeout(function() {
+          this.adjustNewtabButtonTimeout = setTimeout(() => {
             this.adjustNewtabButtonVisibility();
             this.adjustNewtabButtonTimeout = null;
-          }.bind(this), timeout);
+          }, timeout);
         }
       } else {
         this.adjustNewtabButtonVisibility();
@@ -1388,7 +1388,7 @@ gTMPprefObserver = {
         if (typeof this._tabWidthChanged == "undefined") {
           let self = this;
           this._tabWidthChanged = true;
-          [50, 100, 250, 500].forEach(function(timeout) {
+          [50, 100, 250, 500].forEach(timeout => {
             setTimeout(function TMP_tabWidthChanged() {
               if (currentVisible)
                 gBrowser.ensureTabIsVisible(gBrowser.selectedTab);
@@ -2611,7 +2611,7 @@ gTMPprefObserver = {
       }
       if (showNewVersionTab) {
         // open Tabmix page in a new tab
-        window.setTimeout(function() {
+        window.setTimeout(() => {
           let defaultChanged = "";
           let showComment = oldVersion ? Services.vc.compare(oldVersion, "0.4.0.2pre.120330a") <= 0 : false;
           if (showComment && (_loadOnNewTab || _replaceLastTabWith))
@@ -2624,7 +2624,7 @@ gTMPprefObserver = {
         // noting more to do at the moment
       }
     };
-    AddonManager.getAddonByID("{dc572301-7619-498c-a57d-39143191b318}", function(aAddon) {
+    AddonManager.getAddonByID("{dc572301-7619-498c-a57d-39143191b318}", aAddon => {
       try {
         let shouldAutoUpdate = AddonManager.shouldAutoUpdate(aAddon);
         getVersion(aAddon.version, shouldAutoUpdate);
diff --git a/chrome/content/tabmix.js b/chrome/content/tabmix.js
index c243ac8..15a9488 100644
--- a/chrome/content/tabmix.js
+++ b/chrome/content/tabmix.js
@@ -554,7 +554,7 @@ var TMP_eventListener = {
 
     // apply style on tabs
     let styles = ["currentTab", "unloadedTab", "unreadTab", "otherTab"];
-    styles.forEach(function(ruleName) {
+    styles.forEach(ruleName => {
       gTMPprefObserver.updateTabsStyle(ruleName);
     });
     // progressMeter on tabs
@@ -1057,7 +1057,7 @@ var TMP_eventListener = {
     var isLastWindow = Tabmix.numberOfWindows() === 0;
     // we close tabmix dialog windows on exit
     if (isLastWindow) {
-      ["tabmixopt-filetype", "tabmixopt-appearance", "tabmixopt"].forEach(function(aID) {
+      ["tabmixopt-filetype", "tabmixopt-appearance", "tabmixopt"].forEach(aID => {
         var win = Services.wm.getMostRecentWindow("mozilla:" + aID);
         if (win) {
           if (aID != "tabmixopt")
diff --git a/chrome/content/utils.js b/chrome/content/utils.js
index 456e08a..607ae35 100644
--- a/chrome/content/utils.js
+++ b/chrome/content/utils.js
@@ -84,7 +84,7 @@ var Tabmix = {
     if (aFlag)
       this[aModule + "Initialized"] = false;
     var self = this;
-    XPCOMUtils.defineLazyGetter(aObject, aName, function() {
+    XPCOMUtils.defineLazyGetter(aObject, aName, () => {
       let tmp = {};
       Components.utils.import("resource://tabmixplus/" + aModule + ".jsm", tmp);
       let Obj = tmp[aSymbol];
diff --git a/modules/AboutNewTab.jsm b/modules/AboutNewTab.jsm
index 1688f33..49d0528 100644
--- a/modules/AboutNewTab.jsm
+++ b/modules/AboutNewTab.jsm
@@ -9,7 +9,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
 XPCOMUtils.defineLazyModuleGetter(this, "DirectoryLinksProvider",
   "resource:///modules/DirectoryLinksProvider.jsm");
 
-XPCOMUtils.defineLazyGetter(this, "gAllPages", function() {
+XPCOMUtils.defineLazyGetter(this, "gAllPages", () => {
   let tmp = {};
   Cu.import("resource://gre/modules/NewTabUtils.jsm", tmp);
   return tmp.NewTabUtils.allPages;
diff --git a/modules/AutoReload.jsm b/modules/AutoReload.jsm
index 0759ff7..ccc7a22 100644
--- a/modules/AutoReload.jsm
+++ b/modules/AutoReload.jsm
@@ -93,7 +93,7 @@ this.AutoReload = {
       let defaultList = ["30", "60", "120", "300", "900", "1800"];
       list = list.filter(val => defaultList.indexOf(val) == -1);
       let newList = [];
-      list.forEach(function(val) {
+      list.forEach(val => {
         if (parseInt(val) && newList.indexOf(val) == -1)
           newList.push(val);
         if (newList.length > 6)
diff --git a/modules/ContentClick.jsm b/modules/ContentClick.jsm
index 106b5df..8813817 100644
--- a/modules/ContentClick.jsm
+++ b/modules/ContentClick.jsm
@@ -97,7 +97,7 @@ ContentClickInternal = {
     if (!this._initialized)
       return;
 
-    this.functions.forEach(function(aFn) {
+    this.functions.forEach(aFn => {
       ContentClick[aFn] = ContentClick["tabmix_" + aFn];
       delete ContentClick["tabmix_" + aFn];
     });
@@ -105,7 +105,7 @@ ContentClickInternal = {
 
   functions: ["contentAreaClick"],
   initContentAreaClick: function TMP_initContentAreaClick() {
-    this.functions.forEach(function(aFn) {
+    this.functions.forEach(aFn => {
       ContentClick["tabmix_" + aFn] = ContentClick[aFn];
     });
 
@@ -224,12 +224,12 @@ ContentClickInternal = {
     if (href && browser.getAttribute("remote") == "true" &&
         where == "default" && targetAttr) {
       let win = this._window;
-      win.setTimeout(function() {
+      win.setTimeout(() => {
         // don't try to select new tab if the original browser is no longer
         // the selected browser
         if (win.gBrowser.selectedBrowser == browser)
           this.selectExistingTab(win, href, targetAttr);
-      }.bind(this), 300);
+      }, 300);
     }
 
     // don't call this._data.hrefFromOnClick
@@ -255,12 +255,12 @@ ContentClickInternal = {
   },
 
   getPref: function() {
-    XPCOMUtils.defineLazyGetter(this, "targetPref", function() {
+    XPCOMUtils.defineLazyGetter(this, "targetPref", () => {
       return TabmixSvc.prefBranch.getIntPref("opentabforLinks");
     });
 
     let tabBrowser = this._window.gBrowser;
-    XPCOMUtils.defineLazyGetter(this, "currentTabLocked", function() {
+    XPCOMUtils.defineLazyGetter(this, "currentTabLocked", () => {
       return tabBrowser.selectedTab.hasAttribute("locked");
     });
   },
@@ -309,7 +309,7 @@ ContentClickInternal = {
       this.wrappedNode = wrappedNode || null;
       this.wrappedOnClickNode = wrappedOnClickNode || null;
       this.targetAttr = wrappedNode && wrappedNode.target;
-      XPCOMUtils.defineLazyGetter(this, "currentURL", function() {
+      XPCOMUtils.defineLazyGetter(this, "currentURL", () => {
         return self._browser.currentURI ? self._browser.currentURI.spec : "";
       });
       XPCOMUtils.defineLazyGetter(this, "onclick", function() {
diff --git a/modules/DynamicRules.jsm b/modules/DynamicRules.jsm
index ebc262a..775a716 100644
--- a/modules/DynamicRules.jsm
+++ b/modules/DynamicRules.jsm
@@ -12,19 +12,19 @@ XPCOMUtils.defineLazyModuleGetter(this, "Services",
 XPCOMUtils.defineLazyModuleGetter(this, "TabmixSvc",
   "resource://tabmixplus/Services.jsm");
 
-XPCOMUtils.defineLazyGetter(this, "Prefs", function() {
+XPCOMUtils.defineLazyGetter(this, "Prefs", () => {
   return Services.prefs.getBranch("extensions.tabmix.styles.");
 });
 
 var TYPE;
-XPCOMUtils.defineLazyGetter(this, "SSS", function() {
+XPCOMUtils.defineLazyGetter(this, "SSS", () => {
   let sss = Cc['@mozilla.org/content/style-sheet-service;1']
   .getService(Ci.nsIStyleSheetService);
   TYPE = sss.AGENT_SHEET;
   return sss;
 });
 
-XPCOMUtils.defineLazyGetter(this, "isMac", function() {
+XPCOMUtils.defineLazyGetter(this, "isMac", () => {
   return TabmixSvc.isMac && !TabmixSvc.isPaleMoon;
 });
 
@@ -348,7 +348,7 @@ this.DynamicRules = {
     delete this.defaultPrefs;
     let defaults = {};
     let getDefaultBranch = Services.prefs.getDefaultBranch("extensions.tabmix.styles.");
-    STYLENAMES.forEach(function(pref) {
+    STYLENAMES.forEach(pref => {
       defaults[pref] = getDefaultBranch.getCharPref(pref);
     }, this);
     return (this.defaultPrefs = defaults);
diff --git a/modules/MergeWindows.jsm b/modules/MergeWindows.jsm
index 4bd9a72..2a76cbb 100644
--- a/modules/MergeWindows.jsm
+++ b/modules/MergeWindows.jsm
@@ -299,7 +299,7 @@ this.MergeWindows = {
       const priority = notificationBox.PRIORITY_INFO_MEDIUM;
       let notificationBar = notificationBox.appendNotification(errorMessage,
         name, errorimage, priority, null);
-      aWindow.setTimeout(function() {
+      aWindow.setTimeout(() => {
         notificationBox.removeNotification(notificationBar);
       }, 10000);
     }
diff --git a/modules/Places.jsm b/modules/Places.jsm
index 258df96..4e6509a 100644
--- a/modules/Places.jsm
+++ b/modules/Places.jsm
@@ -68,7 +68,7 @@ PlacesUtilsInternal = {
     if (this._timer)
       this._timer.clear();
 
-    this.functions.forEach(function(aFn) {
+    this.functions.forEach(aFn => {
       PlacesUIUtils[aFn] = PlacesUIUtils["tabmix_" + aFn];
       delete PlacesUIUtils["tabmix_" + aFn];
     });
@@ -87,7 +87,7 @@ PlacesUtilsInternal = {
       return;
     }
 
-    this.functions.forEach(function(aFn) {
+    this.functions.forEach(aFn => {
       PlacesUIUtils["tabmix_" + aFn] = PlacesUIUtils[aFn];
     });
 
@@ -126,7 +126,7 @@ PlacesUtilsInternal = {
       // wait until TreeStyleTab changed PlacesUIUtils._openTabset
       let timer = this._timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
       this.__index = 0;
-      timer.initWithCallback(function() {
+      timer.initWithCallback(() => {
         let str = PlacesUIUtils._openTabset.toString();
         if (++this.__index > 10 || str.indexOf("TreeStyleTabBookmarksService") > -1 ||
             str.indexOf("GroupBookmarkBehavior") > -1) {
@@ -135,7 +135,7 @@ PlacesUtilsInternal = {
           this.__index = null;
           updateOpenTabset("_openTabset", true);
         }
-      }.bind(this), 50, Ci.nsITimer.TYPE_REPEATING_SLACK);
+      }, 50, Ci.nsITimer.TYPE_REPEATING_SLACK);
     } else { // TreeStyleTab not installed
       updateOpenTabset("_openTabset");
 
diff --git a/modules/Services.jsm b/modules/Services.jsm
index b3daa7b..15cbaeb 100644
--- a/modules/Services.jsm
+++ b/modules/Services.jsm
@@ -262,7 +262,7 @@ this.TabmixSvc = {
   blockedClickingOptions: []
 };
 
-XPCOMUtils.defineLazyGetter(TabmixSvc.JSON, "nsIJSON", function() {
+XPCOMUtils.defineLazyGetter(TabmixSvc.JSON, "nsIJSON", () => {
   return Cc["@mozilla.org/dom/json;1"].createInstance(Ci.nsIJSON);
 });
 
@@ -271,27 +271,27 @@ XPCOMUtils.defineLazyGetter(TabmixSvc, "australis", function() {
   return Boolean(this.topWin().document.getElementById("tab-curve-clip-path-start"));
 });
 
-XPCOMUtils.defineLazyGetter(TabmixSvc, "prefs", function() {
+XPCOMUtils.defineLazyGetter(TabmixSvc, "prefs", () => {
   let tmp = {};
   Cu.import("resource://gre/modules/Preferences.jsm", tmp);
   return new tmp.Preferences("");
 });
 
 // Tabmix preference branch
-XPCOMUtils.defineLazyGetter(TabmixSvc, "prefBranch", function() {
+XPCOMUtils.defineLazyGetter(TabmixSvc, "prefBranch", () => {
   return Services.prefs.getBranch("extensions.tabmix.");
 });
 // string bundle
-XPCOMUtils.defineLazyGetter(TabmixSvc, "_strings", function() {
+XPCOMUtils.defineLazyGetter(TabmixSvc, "_strings", () => {
   let properties = "chrome://tabmixplus/locale/tabmix.properties";
   return Services.strings.createBundle(properties);
 });
-XPCOMUtils.defineLazyGetter(TabmixSvc, "SMstrings", function() {
+XPCOMUtils.defineLazyGetter(TabmixSvc, "SMstrings", () => {
   let properties = "chrome://tabmixplus/locale/session-manager.properties";
   return Services.strings.createBundle(properties);
 });
 
-XPCOMUtils.defineLazyGetter(this, "Platform", function() {
+XPCOMUtils.defineLazyGetter(this, "Platform", () => {
   if (isVersion(390)) {
     return (Cu.import("resource://gre/modules/AppConstants.jsm", {})).AppConstants.platform;
   }
@@ -307,27 +307,27 @@ XPCOMUtils.defineLazyGetter(this, "Platform", function() {
   return platform;
 });
 
-XPCOMUtils.defineLazyGetter(TabmixSvc, "isWindows", function() {
+XPCOMUtils.defineLazyGetter(TabmixSvc, "isWindows", () => {
   return Platform == "win";
 });
 
-XPCOMUtils.defineLazyGetter(TabmixSvc, "isMac", function() {
+XPCOMUtils.defineLazyGetter(TabmixSvc, "isMac", () => {
   return Platform == "macosx";
 });
 
-XPCOMUtils.defineLazyGetter(TabmixSvc, "isLinux", function() {
+XPCOMUtils.defineLazyGetter(TabmixSvc, "isLinux", () => {
   return Platform == "linux";
 });
 
-XPCOMUtils.defineLazyGetter(TabmixSvc, "isCyberfox", function() {
+XPCOMUtils.defineLazyGetter(TabmixSvc, "isCyberfox", () => {
   return Services.appinfo.name == "Cyberfox";
 });
 
-XPCOMUtils.defineLazyGetter(TabmixSvc, "isPaleMoon", function() {
+XPCOMUtils.defineLazyGetter(TabmixSvc, "isPaleMoon", () => {
   return Services.appinfo.name == "Pale Moon";
 });
 
-XPCOMUtils.defineLazyGetter(TabmixSvc, "isPaleMoonID", function() {
+XPCOMUtils.defineLazyGetter(TabmixSvc, "isPaleMoonID", () => {
   try {
     // noinspection SpellCheckingInspection
     return Services.appinfo.ID == "{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}";
@@ -342,7 +342,7 @@ XPCOMUtils.defineLazyModuleGetter(TabmixSvc, "FileUtils",
 XPCOMUtils.defineLazyModuleGetter(TabmixSvc, "console",
   "resource://tabmixplus/log.jsm");
 
-XPCOMUtils.defineLazyGetter(TabmixSvc, "ss", function() {
+XPCOMUtils.defineLazyGetter(TabmixSvc, "ss", () => {
   let tmp = {};
   Cu.import("resource:///modules/sessionstore/SessionStore.jsm", tmp);
   return tmp.SessionStore;
@@ -387,7 +387,7 @@ tabStateCache = {
 
     let attribs = attrib.split(",");
     function update(attributes) {
-      attribs.forEach(function(key) {
+      attribs.forEach(key => {
         if (tab.hasAttribute(key))
           attributes[key] = tab.getAttribute(key);
         else if (key in attributes)
diff --git a/modules/Shortcuts.jsm b/modules/Shortcuts.jsm
index e72867f..26c5dc8 100644
--- a/modules/Shortcuts.jsm
+++ b/modules/Shortcuts.jsm
@@ -202,7 +202,7 @@ this.Shortcuts = {
 
     aWindow.addEventListener("unload", this, false);
 
-    XPCOMUtils.defineLazyGetter(aWindow.Tabmix, "removedShortcuts", function() {
+    XPCOMUtils.defineLazyGetter(aWindow.Tabmix, "removedShortcuts", () => {
       let document = aWindow.document;
       return document.documentElement.appendChild(document.createElement("tabmix_shortcuts"));
     });
@@ -558,7 +558,7 @@ function getFormattedKey(key) {
 
   if (key.modifiers) {
     let sep = getPlatformKeys("MODIFIER_SEPARATOR");
-    key.modifiers.replace(/^[\s,]+|[\s,]+$/g, "").split(/[\s,]+/g).forEach(function(mod) {
+    key.modifiers.replace(/^[\s,]+|[\s,]+$/g, "").split(/[\s,]+/g).forEach(mod => {
       if (/alt|shift|control|meta|accel/.test(mod))
         val += getPlatformKeys("VK_" + mod.toUpperCase()) + sep;
     });
diff --git a/modules/Slideshow.jsm b/modules/Slideshow.jsm
index 15cfbd6..a5472b2 100644
--- a/modules/Slideshow.jsm
+++ b/modules/Slideshow.jsm
@@ -14,7 +14,7 @@ function flst() {
   this.flstOff = TabmixSvc.getString("flstOff.label");
   this.slideshowOn = TabmixSvc.getString("slideshowOn.label");
   this.slideshowOff = TabmixSvc.getString("slideshowOff.label");
-  XPCOMUtils.defineLazyGetter(this, "tabContainer", function() {
+  XPCOMUtils.defineLazyGetter(this, "tabContainer", () => {
     return TabmixSvc.topWin().gBrowser.tabContainer;
   });
 }
diff --git a/modules/TabGroupsMigrator.jsm b/modules/TabGroupsMigrator.jsm
index 7f17a4a..7623bab 100644
--- a/modules/TabGroupsMigrator.jsm
+++ b/modules/TabGroupsMigrator.jsm
@@ -12,7 +12,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "Services",
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
   "resource://gre/modules/Promise.jsm");
 
-XPCOMUtils.defineLazyGetter(this, "TabGroupsMigrator", function() {
+XPCOMUtils.defineLazyGetter(this, "TabGroupsMigrator", () => {
   if (!TabmixSvc.version(450)) {
     return null;
   }
@@ -40,7 +40,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "TabmixSvc",
 XPCOMUtils.defineLazyModuleGetter(this, "TabmixPlacesUtils",
   "resource://tabmixplus/Places.jsm");
 
-XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() {
+XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", () => {
   return Services.strings.createBundle('chrome://browser/locale/browser.properties');
 });
 
diff --git a/modules/extensions/AddonManager.jsm b/modules/extensions/AddonManager.jsm
index b79aebc..84e9729 100644
--- a/modules/extensions/AddonManager.jsm
+++ b/modules/extensions/AddonManager.jsm
@@ -30,7 +30,7 @@ var TabGroups = {
   },
   onEnabled: function() {
     if (this.isUpdateNeeded()) {
-      TabmixSvc.forEachBrowserWindow(function(aWindow) {
+      TabmixSvc.forEachBrowserWindow(aWindow => {
         aWindow.TMP_TabView.init();
       });
     }
@@ -69,7 +69,7 @@ var PrivateTab = {
     this._resetNewTabButton();
   },
   _resetNewTabButton: function() {
-    TabmixSvc.forEachBrowserWindow(function(aWindow) {
+    TabmixSvc.forEachBrowserWindow(aWindow => {
       aWindow.TMP_eventListener.updateMultiRow(true);
     });
   }
@@ -157,7 +157,7 @@ var TabmixAddonManager = {
     this.initialized = true;
 
     AddonManager.addAddonListener(TabmixListener);
-    AddonManager.getAddonsByTypes(["extension"], function(addons) {
+    AddonManager.getAddonsByTypes(["extension"], addons => {
       addons.forEach(addon => {
         if (addon.isActive) {
           TabmixListener.init(addon.id);
diff --git a/modules/extensions/CompatibilityCheck.jsm b/modules/extensions/CompatibilityCheck.jsm
index e128785..04de308 100644
--- a/modules/extensions/CompatibilityCheck.jsm
+++ b/modules/extensions/CompatibilityCheck.jsm
@@ -69,7 +69,7 @@ CompatibilityCheck.prototype = {
 
     var guid_list = this.getList();
     var self = this;
-    AddonManager.getAddonsByTypes(["extension"], function(aAddonsList) {
+    AddonManager.getAddonsByTypes(["extension"], aAddonsList => {
       for (let i = 0; i < aAddonsList.length; i++) {
         let addon = aAddonsList[i];
         if (addon.id.toLowerCase() in guid_list) {
@@ -147,8 +147,8 @@ CompatibilityCheck.prototype = {
 
   doDisable: function TMP_EX_doDisable() {
     var list = this.list;
-    list.forEach(function(aAddonToDisable) {
-      AddonManager.getAddonByID(aAddonToDisable.id, function(aAddon) {
+    list.forEach(aAddonToDisable => {
+      AddonManager.getAddonByID(aAddonToDisable.id, aAddon => {
         aAddon.userDisabled = true;
       });
     });
diff --git a/modules/log.jsm b/modules/log.jsm
index 6b98ac3..9c9e09e 100644
--- a/modules/log.jsm
+++ b/modules/log.jsm
@@ -7,7 +7,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 Cu.import("resource://gre/modules/Services.jsm", this);
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
 
-XPCOMUtils.defineLazyGetter(this, "OS", function() {
+XPCOMUtils.defineLazyGetter(this, "OS", () => {
   return Cu.import("resource://gre/modules/osfile.jsm", {}).OS;
 });
 
@@ -245,7 +245,7 @@ options = {
 
   _formatStack: function(stack) {
     let lines = [], _char = this._char, re = this._pathRegExp;
-    stack.forEach(function(line) {
+    stack.forEach(line => {
       let atIndex = line.indexOf("@");
       let columnIndex = line.lastIndexOf(":");
       let fileName = line.slice(atIndex + 1, columnIndex).split(" -> ").pop();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git



More information about the Pkg-mozext-commits mailing list