[Pkg-mozext-commits] [tabmixplus] 32/73: Enable Eslint 'no-useless-concat'

David Prévot taffit at moszumanska.debian.org
Mon May 9 02:30:52 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 8c4e25f15107cedad81295109657848f828434ea
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sun Apr 3 20:29:02 2016 +0300

    Enable Eslint 'no-useless-concat'
---
 .eslintrc.js                      | 2 +-
 chrome/content/changecode.js      | 1 +
 chrome/content/session/session.js | 4 ++--
 chrome/content/tab/tab.js         | 2 +-
 chrome/content/utils.js           | 2 +-
 modules/log.jsm                   | 4 ++--
 6 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/.eslintrc.js b/.eslintrc.js
index f20b086..a41e5fd 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -131,7 +131,7 @@ module.exports = {
     "no-unused-vars": [2, {"vars": "all", "args": "after-used"}],
     "no-use-before-define": [2, "nofunc"],
     "no-useless-call": 0,
-    "no-useless-concat": 0,
+    "no-useless-concat": 2,
     "no-useless-constructor": 2,
     "no-useless-escape": 0,
     "no-void": 0,
diff --git a/chrome/content/changecode.js b/chrome/content/changecode.js
index 0db6724..bda76e8 100644
--- a/chrome/content/changecode.js
+++ b/chrome/content/changecode.js
@@ -180,6 +180,7 @@ Tabmix.nonStrictMode = function(aObj, aFn, aArg) {
 
 (function(obj) {
   let global = Components.utils.getGlobalForObject(obj);
+  // eslint-disable-next-line no-useless-concat
   let fn = global["ev" + "al"];
   Tabmix._makeCode = function(name, code) {
     if (name) {
diff --git a/chrome/content/session/session.js b/chrome/content/session/session.js
index 838d9cc..f35a5cd 100644
--- a/chrome/content/session/session.js
+++ b/chrome/content/session/session.js
@@ -964,7 +964,7 @@ TabmixSessionManager = {
     var root = this.getResource(path, prop);
     var container = this.initContainer(root);
     if (container == "error") {
-      Tabmix.log("wrapContainer error path " + path + "\n" + "prop " + prop);
+      Tabmix.log("wrapContainer error path " + path + "\nprop " + prop);
       return "error";
     }
     return {
@@ -1255,7 +1255,7 @@ TabmixSessionManager = {
         this._interval += 500;
         this.saveStateDelayed();
       }
-      Services.console.logStringMessage("TabMix :\n" + "Error when tabmix try to write to session.rdf file");
+      Services.console.logStringMessage("TabMix :\nError when tabmix try to write to session.rdf file");
     }
   },
 
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index 40e9c85..65acb8a 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -1229,7 +1229,7 @@ gTMPprefObserver = {
       for (var i = 0; i < this.OBSERVING.length; ++i)
         Services.prefs.addObserver(this.OBSERVING[i], this, false);
     } catch (e) {
-      Tabmix.log("prefs-Observer failed to attach:" + "\n" + e);
+      Tabmix.log("prefs-Observer failed to attach:\n" + e);
       Tabmix.prefs.setBoolPref("PrefObserver.error", true);
     }
   },
diff --git a/chrome/content/utils.js b/chrome/content/utils.js
index ddab77a..77a1773 100644
--- a/chrome/content/utils.js
+++ b/chrome/content/utils.js
@@ -122,7 +122,7 @@ var Tabmix = {
       let extensionName = index > -1 ?
          path.charAt(2).toUpperCase() + path.substr(3, index) + " " : "";
       this.clog(err.message + "\n\n" + extensionName + "extension call " + aOldName +
-                 " from:\n" + "file: " + "chrome:" + path + "\nline: " + line +
+                 " from:\nfile: chrome:" + path + "\nline: " + line +
                  "\n\nPlease inform Tabmix Plus developer" +
                  (extensionName ? (" and " + extensionName + "developer.") : "."));
     } else {
diff --git a/modules/log.jsm b/modules/log.jsm
index cb04e5d..7c54332 100644
--- a/modules/log.jsm
+++ b/modules/log.jsm
@@ -210,11 +210,11 @@ options = {
             "[native code]" : "[code]";
           val = val.substr(0, val.indexOf("(")) + "() { " + code + " }";
         }
-        objS += offset + prop + "[" + type + "]" + " =  " + val + "\n";
+        objS += offset + prop + "[" + type + "] =  " + val + "\n";
         if (type == "object" && val !== null && level && typeof level == "boolean")
           objS += this.obj(val, "", true, "deep") + "\n";
       } catch (ex) {
-        objS += offset + prop + " =  " + "[!!error retrieving property]" + "\n";
+        objS += offset + prop + " =  [!!error retrieving property]\n";
       }
     }
     if (aDisallowLog)

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