[Pkg-mozext-commits] [tabmixplus] 11/34: Fix some Eslint errors after tabmix/import-globals plugin improved to find declared but unused variables

David Prévot taffit at moszumanska.debian.org
Mon Jun 27 13:57:56 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 10b84c78a2ca13c79e459919a978263ed22831f1
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sat Jun 11 11:09:49 2016 +0300

    Fix some Eslint errors after tabmix/import-globals plugin improved to find declared but unused variables
---
 modules/AsyncUtils.jsm      | 2 --
 modules/ContentClick.jsm    | 1 +
 modules/ContextMenu.jsm     | 4 +---
 modules/DownloadLastDir.jsm | 3 ---
 modules/LinkNodeUtils.jsm   | 7 -------
 modules/Places.jsm          | 9 +++++----
 modules/Services.jsm        | 1 +
 7 files changed, 8 insertions(+), 19 deletions(-)

diff --git a/modules/AsyncUtils.jsm b/modules/AsyncUtils.jsm
index f4e3d9b..9b50a44 100644
--- a/modules/AsyncUtils.jsm
+++ b/modules/AsyncUtils.jsm
@@ -9,8 +9,6 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Promise",
                                   "resource://gre/modules/Promise.jsm");
 
-XPCOMUtils.defineLazyModuleGetter(this, "TabmixSvc",
-                                  "resource://tabmixplus/Services.jsm");
 this.AsyncUtils = {
   /* PromiseUtils.defer exist since Firefox 39 */
   defer: function() {
diff --git a/modules/ContentClick.jsm b/modules/ContentClick.jsm
index 72069ee..39df08d 100644
--- a/modules/ContentClick.jsm
+++ b/modules/ContentClick.jsm
@@ -612,6 +612,7 @@ ContentClickInternal = {
     var GM_function;
     try {
       // Greasemonkey >= 0.9.10
+      // eslint-disable-next-line tabmix/import-globals
       Cu.import("resource://greasemonkey/util.js");
       if (typeof window.GM_util.getEnabled == 'function') {
         GM_function = window.GM_util.getEnabled;
diff --git a/modules/ContextMenu.jsm b/modules/ContextMenu.jsm
index c3cfdc1..7bc136d 100644
--- a/modules/ContextMenu.jsm
+++ b/modules/ContextMenu.jsm
@@ -4,11 +4,9 @@ this.EXPORTED_SYMBOLS = ["ContextMenu"];
 
 const {interfaces: Ci, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
-XPCOMUtils.defineLazyModuleGetter(this, "TabmixSvc",
-  "resource://tabmixplus/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "TabmixUtils",
                                   "resource://tabmixplus/Utils.jsm");
 
diff --git a/modules/DownloadLastDir.jsm b/modules/DownloadLastDir.jsm
index d118df8..7c95681 100644
--- a/modules/DownloadLastDir.jsm
+++ b/modules/DownloadLastDir.jsm
@@ -11,9 +11,6 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
   "resource://gre/modules/Services.jsm");
 
-XPCOMUtils.defineLazyModuleGetter(this, "TabmixSvc",
-  "resource://tabmixplus/Services.jsm");
-
 this.TabmixDownloadLastDir = {
   _initialized: false,
   init: function() {
diff --git a/modules/LinkNodeUtils.jsm b/modules/LinkNodeUtils.jsm
index 49e115c..cdbe61a 100644
--- a/modules/LinkNodeUtils.jsm
+++ b/modules/LinkNodeUtils.jsm
@@ -2,13 +2,6 @@
 
 this.EXPORTED_SYMBOLS = ["LinkNodeUtils"];
 
-const Cu = Components.utils;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "TabmixSvc",
-  "resource://tabmixplus/Services.jsm");
-
 const ATTRIBS = ["onclick", "rel", "onmousedown"];
 
 this.LinkNodeUtils = {
diff --git a/modules/Places.jsm b/modules/Places.jsm
index 09c04ed..97e494c 100644
--- a/modules/Places.jsm
+++ b/modules/Places.jsm
@@ -9,19 +9,20 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
   "resource://gre/modules/Services.jsm");
 
+// these imports are used by PlacesUIUtils and PlacesUtils that we eval here
+/* eslint-disable tabmix/import-globals */
 XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
   "resource://gre/modules/PluralForm.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
   "resource://gre/modules/PrivateBrowsingUtils.jsm");
+/* eslint-enable tabmix/import-globals */
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUIUtils",
   "resource:///modules/PlacesUIUtils.jsm");
 
-XPCOMUtils.defineLazyGetter(this, "PlacesUtils", function() {
-  Cu.import("resource://gre/modules/PlacesUtils.jsm");
-  return PlacesUtils;
-});
+XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
+  "resource://gre/modules/PlacesUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this,
   "TabmixSvc", "resource://tabmixplus/Services.jsm");
diff --git a/modules/Services.jsm b/modules/Services.jsm
index 7896a01..1a4ceba 100644
--- a/modules/Services.jsm
+++ b/modules/Services.jsm
@@ -184,6 +184,7 @@ this.TabmixSvc = {
 
       Services.obs.addObserver(this, "quit-application", true);
 
+      // eslint-disable-next-line tabmix/import-globals
       Cu.import("resource://tabmixplus/DownloadLastDir.jsm");
 
       TabmixPlacesUtils.init(aWindow);

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