[Pkg-mozext-commits] [tabmixplus] 14/107: Fix eslint error Designated alias 'self' is not assigned to 'this'. Use arrow function in setTimeout

David Prévot taffit at moszumanska.debian.org
Tue Dec 29 19:02:45 UTC 2015


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit 43219f4a9641efc8be10689ef0f3b7383fc61168
Author: onemen <tabmix.onemen at gmail.com>
Date:   Mon Oct 12 18:15:42 2015 +0300

    Fix eslint error Designated alias 'self' is not assigned to 'this'. Use arrow function in setTimeout
---
 chrome/content/click/click.js                         |  5 +++--
 chrome/content/flst/lasttab.js                        | 10 +++++-----
 chrome/content/preferences/menu.js                    |  2 +-
 .../content/preferences/overlay/preferencesOverlay.js |  4 +---
 chrome/content/tab/tab.js                             | 19 +++++++++----------
 modules/log.jsm                                       | 10 +++++-----
 6 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/chrome/content/click/click.js b/chrome/content/click/click.js
index 52278ce..7f2e11d 100644
--- a/chrome/content/click/click.js
+++ b/chrome/content/click/click.js
@@ -18,8 +18,9 @@ var TabmixTabClickOptions = {
     if (leftClick && aEvent.detail > 1) {
       if (this._tabFlipTimeOut)
         this.clearTabFlipTimeOut();
-      if (this._blockDblClick)
-        setTimeout(function(self) {self._blockDblClick = false;}, 0, this);
+      if (this._blockDblClick) {
+        setTimeout(() => this._blockDblClick = false, 0);
+      }
       return; // double click (with left button)
     }
 
diff --git a/chrome/content/flst/lasttab.js b/chrome/content/flst/lasttab.js
index 2d87602..8060b10 100644
--- a/chrome/content/flst/lasttab.js
+++ b/chrome/content/flst/lasttab.js
@@ -213,11 +213,11 @@ var TMP_LastTab = {
             if (!this.TabListLock) {
                if (tabCount > 1) {
                  if (!this._timer) {
-                   this._timer = setTimeout(function(self) {
-                     self._timer = null;
-                     if (!self.TabListLock)
-                       self.DisplayTabList();
-                   }, 200, this);
+                   this._timer = setTimeout(() => {
+                     this._timer = null;
+                     if (!this.TabListLock)
+                       this.DisplayTabList();
+                   }, 200);
                  }
                  else
                    this.DisplayTabList();
diff --git a/chrome/content/preferences/menu.js b/chrome/content/preferences/menu.js
index 6396705..87d2448 100644
--- a/chrome/content/preferences/menu.js
+++ b/chrome/content/preferences/menu.js
@@ -48,7 +48,7 @@ var gMenuPane = { // jshint ignore:line
     let paneMenu = $("paneMenu");
     if (paneMenu.hasAttribute("editSlideShowKey")) {
       paneMenu.removeAttribute("editSlideShowKey");
-      setTimeout(function(self) {self.editSlideShowKey();}, 0, this);
+      setTimeout(() => this.editSlideShowKey(), 0);
     }
 
     gPrefWindow.initPane("paneMenu");
diff --git a/chrome/content/preferences/overlay/preferencesOverlay.js b/chrome/content/preferences/overlay/preferencesOverlay.js
index 50dac1b..89057ac 100644
--- a/chrome/content/preferences/overlay/preferencesOverlay.js
+++ b/chrome/content/preferences/overlay/preferencesOverlay.js
@@ -35,9 +35,7 @@ var gTabMix_preferencesOverlay = { // jshint ignore:line
     }
 
     this.initMainPane();
-    setTimeout(function(self) {
-      self.initPaneTabsOptions();
-    }, 0, this);
+    setTimeout(() => this.initPaneTabsOptions(), 0);
   },
 
 /* ........ paneTabs .............. */
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index ba6ac33..3cf131b 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -154,16 +154,15 @@ var TabmixTabbar = {
     Tabmix.setItem(tabBar, "tabBarSpace", Tabmix.prefs.getBoolPref("tabBarSpace") || null);
     this.setShowNewTabButtonAttr();
 
-    var self = this;
     if (start)
-      window.setTimeout(function TMP_updateSettings_onstart() {self.updateScrollStatus();}, 0);
+      window.setTimeout(() => this.updateScrollStatus(), 0);
     else
       this.updateScrollStatus();
 
-    window.setTimeout(function TMP_updateSettings_adjustScroll(_currentVisible) {
-        if (_currentVisible)
-          gBrowser.ensureTabIsVisible(gBrowser.selectedTab);
-        self.updateBeforeAndAfter();
+    window.setTimeout(_currentVisible => {
+      if (_currentVisible)
+        gBrowser.ensureTabIsVisible(gBrowser.selectedTab);
+      this.updateBeforeAndAfter();
     }, 50, currentVisible);
   },
 
@@ -1506,7 +1505,7 @@ var gTMPprefObserver = {
         gBrowser.tabContainer.moveTabOnDragging = Services.prefs.getBoolPref(prefName);
         break;
       case "layout.css.devPixelsPerPx":
-        setTimeout(function(self) {self.setBgMiddleMargin();}, 0, this);
+        setTimeout(() => this.setBgMiddleMargin(), 0);
         break;
       case "extensions.tabmix.showTabContextMenuOnTabbar":
         TabmixContext.updateTabbarContextMenu(Services.prefs.getBoolPref(prefName));
@@ -2613,10 +2612,10 @@ var TabmixProgressListener = {
           this.mTabBrowser.hideTab(tab);
           TabmixTabbar.updateScrollStatus();
           // let to unknownContentType dialog or nsIFilePicker time to open
-          tab._tabmix_downloadingTimeout = tab.ownerDocument.defaultView.setTimeout(function(self) {
+          tab._tabmix_downloadingTimeout = tab.ownerDocument.defaultView.setTimeout(() => {
             tab._tabmix_downloadingTimeout = null;
-            if (self && self.mTabBrowser && tab && tab.parentNode)
-              self.mTabBrowser.removeTab(tab, {animate: false});
+            if (this && this.mTabBrowser && tab && tab.parentNode)
+              this.mTabBrowser.removeTab(tab, {animate: false});
           }, 500, this);
         }
 
diff --git a/modules/log.jsm b/modules/log.jsm
index e503cb0..0b2e486 100644
--- a/modules/log.jsm
+++ b/modules/log.jsm
@@ -287,7 +287,7 @@ options = {
     this._logMessage(assertionText + stackText, "errorFlag");
   },
 
-  trace: function TMP_console_trace(aMsg, flag="infoFlag", caller=null) {
+  trace: function TMP_console_trace(aMsg, flag = "infoFlag", caller = null) {
     let stack = this._formatStack(this._getStackExcludingInternal());
     let msg = aMsg ? aMsg + "\n" : "";
     this._logMessage(":\n" + msg + "Stack Trace:\n" + stack, flag, caller);
@@ -301,7 +301,7 @@ options = {
     return parent;
   },
 
-  reportError: function(ex=null, msg="") {
+  reportError: function(ex = null, msg = "") {
     if (ex === null) {
       ex = "reportError was called with null";
     }
@@ -318,7 +318,7 @@ options = {
     }
   },
 
-  _logMessage: function _logMessage(msg, flag="infoFlag", caller=null) {
+  _logMessage: function _logMessage(msg, flag = "infoFlag", caller = null) {
     msg = msg.replace(/\r\n/g, "\n");
     if (typeof Ci.nsIScriptError[flag] == "undefined") {
       Services.console.logStringMessage("Tabmix" + msg);
@@ -335,6 +335,6 @@ options = {
 
 };
 
-(function(self) {
-  self.reportError = self.reportError.bind(self);
+(function(_this) {
+  _this.reportError = _this.reportError.bind(_this);
 }(this.console));

-- 
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