[Pkg-mozext-commits] [tabmixplus] 05/44: Turn on eslint-plugin-mozilla/balanced-listeners and fix errors

David Prévot taffit at moszumanska.debian.org
Fri Mar 18 20:57:14 UTC 2016


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit 1635ba6076a09c08c9e7da6668f850343e658131
Author: onemen <tabmix.onemen at gmail.com>
Date:   Fri Feb 19 14:18:33 2016 +0200

    Turn on eslint-plugin-mozilla/balanced-listeners and fix errors
---
 .eslintrc_mozilla                      | 1 +
 chrome/content/content.js              | 1 +
 chrome/content/minit/minit.js          | 5 +++++
 chrome/content/minit/tabView.js        | 4 ++--
 chrome/content/minit/tablib.js         | 2 ++
 chrome/content/session/session.js      | 2 ++
 chrome/content/session/sessionStore.js | 2 ++
 chrome/content/tab/scrollbox.xml       | 4 ++--
 chrome/content/tabmix.js               | 4 ----
 modules/log.jsm                        | 3 ++-
 10 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/.eslintrc_mozilla b/.eslintrc_mozilla
index 042669f..f44a1d4 100644
--- a/.eslintrc_mozilla
+++ b/.eslintrc_mozilla
@@ -2,5 +2,6 @@
     "plugins": ["eslint-plugin-mozilla"],
 
     "rules": {
+      "mozilla/balanced-listeners": 2
     }
 }
diff --git a/chrome/content/content.js b/chrome/content/content.js
index 656ebed..ea193d9 100644
--- a/chrome/content/content.js
+++ b/chrome/content/content.js
@@ -1,3 +1,4 @@
+/* eslint mozilla/balanced-listeners:0 */
 "use strict";
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components; // jshint ignore:line
diff --git a/chrome/content/minit/minit.js b/chrome/content/minit/minit.js
index 27f7eca..a9fa0cc 100644
--- a/chrome/content/minit/minit.js
+++ b/chrome/content/minit/minit.js
@@ -1057,6 +1057,11 @@ Tabmix.navToolbox = {
     CustomizableUI.removeWidgetFromArea("tabmixScrollBox");
     if (Tabmix.isVersion(290))
       CustomizableUI.removeListener(this.listener);
+
+    let alltabsPopup = document.getElementById("alltabs-popup");
+    if (alltabsPopup && alltabsPopup._tabmix_inited) {
+      alltabsPopup.removeEventListener("popupshown", alltabsPopup.__ensureElementIsVisible, false);
+    }
   },
 
   cleanCurrentset: function() {
diff --git a/chrome/content/minit/tabView.js b/chrome/content/minit/tabView.js
index 4729474..46da028 100644
--- a/chrome/content/minit/tabView.js
+++ b/chrome/content/minit/tabView.js
@@ -177,8 +177,8 @@
   TMP_TabView._resetTabviewFrame = function SM__resetTabviewFrame() {
     var tabView = document.getElementById("tab-view-deck");
     if (tabView) {
-      tabView.removeEventListener("tabviewhidden", this, false);
-      tabView.removeEventListener("tabviewshown", this, false);
+      tabView.removeEventListener("tabviewhidden", this, true);
+      tabView.removeEventListener("tabviewshown", this, true);
       gBrowser.tabContainer.removeEventListener("TabShow", this, true);
       gBrowser.tabContainer.removeEventListener("TabHide", this, true);
     }
diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index 0207f9c..566ff8f 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -909,6 +909,7 @@ var tablib = { // eslint-disable-line
   },
 
   populateUndoWindowSubmenu: function(undoPopup) {
+    /* eslint-disable mozilla/balanced-listeners */
     if (!undoPopup.hasAttribute("context"))
       undoPopup.setAttribute("context", "tm_undocloseWindowContextMenu");
     let undoItems = JSON.parse(TabmixSvc.ss.getClosedWindowData());
@@ -944,6 +945,7 @@ var tablib = { // eslint-disable-line
       TabmixSessionManager.forgetClosedWindow(-1);
     });
     undoPopup.insertBefore(clearList, restoreAllWindows);
+    /* eslint-enable mozilla/balanced-listeners */
   },
 
   addNewFunctionsTo_gBrowser: function addNewFunctionsTo_gBrowser() {
diff --git a/chrome/content/session/session.js b/chrome/content/session/session.js
index 6843ef6..3b15ddf 100644
--- a/chrome/content/session/session.js
+++ b/chrome/content/session/session.js
@@ -1871,6 +1871,7 @@ var TabmixSessionManager = { // jshint ignore:line
   },
 
   createMenu: function SM_createMenu(popup, container, contents, aNoSeparators) {
+    /* eslint-disable mozilla/balanced-listeners */
     if (popup.id == "btn_closedwindows_menu") {
       let contextmenu = !this.enableManager ? "tm_undocloseWindowContextMenu" : "tm_sessionmanagerContextMenu";
       document.getElementById("btn_closedwindows_menu").setAttribute("context", contextmenu);
@@ -2006,6 +2007,7 @@ var TabmixSessionManager = { // jshint ignore:line
     var deleteItem = popup.getElementsByAttribute("anonid", "delete")[0];
     if (deleteItem)
       Tabmix.setItem(deleteItem, "disabled", allEmpty && count === 0 ? true : null);
+    /* eslint-enable mozilla/balanced-listeners */
   },
 
   // set defaultIndex, sessionIndex and default Attribute
diff --git a/chrome/content/session/sessionStore.js b/chrome/content/session/sessionStore.js
index ac7a5e7..2fcd288 100644
--- a/chrome/content/session/sessionStore.js
+++ b/chrome/content/session/sessionStore.js
@@ -359,6 +359,7 @@ var TMP_ClosedTabs = { // jshint ignore:line
   /* .......... functions for closedtabs list menu and context menu .......... */
 
   populateUndoSubmenu: function ct_populateUndoSubmenu(aPopup) {
+    /* eslint-disable mozilla/balanced-listeners */
     if (TabmixAllTabs.isAfterCtrlClick(aPopup.parentNode))
       return false;
 
@@ -435,6 +436,7 @@ var TMP_ClosedTabs = { // jshint ignore:line
       TMP_ClosedTabs.restoreTab('original', -2);
     });
     return true;
+    /* eslint-enable mozilla/balanced-listeners */
   },
 
   restoreCommand: function(aEvent) {
diff --git a/chrome/content/tab/scrollbox.xml b/chrome/content/tab/scrollbox.xml
index af928da..d5fd43a 100644
--- a/chrome/content/tab/scrollbox.xml
+++ b/chrome/content/tab/scrollbox.xml
@@ -237,8 +237,8 @@
 
       <destructor>
         <![CDATA[
-          this._scrollButtonUpLeft.removeEventListener("oncontextmenu", this._createScrollButtonContextMenu, true);
-          this._scrollButtonDownLeft.removeEventListener("oncontextmenu", this._createScrollButtonContextMenu, true);
+          this._scrollButtonUpLeft.removeEventListener("contextmenu", this._createScrollButtonContextMenu, true);
+          this._scrollButtonDownLeft.removeEventListener("contextmenu", this._createScrollButtonContextMenu, true);
 
           Services.prefs.removeObserver("toolkit.scrollbox.", this.tabmixPrefObserver);
         ]]>
diff --git a/chrome/content/tabmix.js b/chrome/content/tabmix.js
index 11a4400..a008a4c 100644
--- a/chrome/content/tabmix.js
+++ b/chrome/content/tabmix.js
@@ -1069,10 +1069,6 @@ var TMP_eventListener = {
 
     this.toggleEventListener(gBrowser.tabContainer, this._tabEvents, false);
 
-    let alltabsPopup = document.getElementById("alltabs-popup");
-    if (alltabsPopup && alltabsPopup._tabmix_inited)
-      alltabsPopup.removeEventListener("popupshown", alltabsPopup.__ensureElementIsVisible, false);
-
     gBrowser.tabContainer.removeEventListener("DOMMouseScroll", this, true);
 
     if (TMP_TabView.installed)
diff --git a/modules/log.jsm b/modules/log.jsm
index aa6997f..4ec4117 100644
--- a/modules/log.jsm
+++ b/modules/log.jsm
@@ -66,7 +66,8 @@ this.console = {
           timer.cancel();
         }.bind(this);
         if (aWindow) {
-          aWindow.addEventListener("unload", function unload() {
+          aWindow.addEventListener("unload", function unload(event) {
+            event.currentTarget.removeEventListener("unload", unload, false);
             timer.clear();
           }, false);
         }

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