[Pkg-mozext-commits] [requestpolicy] 180/257: [ref] coding style: fix some JSCS issues

David Prévot taffit at moszumanska.debian.org
Thu Jan 28 03:20:10 UTC 2016


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

taffit pushed a commit to branch master
in repository requestpolicy.

commit 77fd3c19264a7cd97cdeb50f7ca914eec35ef02b
Author: Martin Kimmerle <dev at 256k.de>
Date:   Tue Dec 1 19:44:52 2015 +0100

    [ref] coding style: fix some JSCS issues
---
 src/content/lib/environment.jsm                   |  2 +-
 src/content/lib/environment.process.js            |  6 ++++--
 src/content/lib/gui-location.jsm                  | 24 +++++++++++------------
 src/content/lib/manager-for-message-listeners.jsm |  7 +++----
 src/content/lib/observer-manager.jsm              |  5 +++--
 src/content/lib/request-processor.redirects.js    |  4 ++--
 src/content/lib/request-set.jsm                   |  4 +++-
 src/content/lib/request.jsm                       |  6 ++++--
 src/content/lib/subscription.jsm                  |  4 +++-
 9 files changed, 34 insertions(+), 28 deletions(-)

diff --git a/src/content/lib/environment.jsm b/src/content/lib/environment.jsm
index 20b16b8..9c8d234 100644
--- a/src/content/lib/environment.jsm
+++ b/src/content/lib/environment.jsm
@@ -339,7 +339,7 @@ var Environment = (function() {
 
   // have a scope/closure for private functions specific to
   // startup() and shutdown().
-  (function createMethods_StartupAndShutdown(Environment) {
+  (function createMethodsStartupAndShutdown(Environment) {
     /**
      * Iterates all levels of either the startup or the shutdown
      * sequence and calls a function for each level.
diff --git a/src/content/lib/environment.process.js b/src/content/lib/environment.process.js
index 6a252b3..3419bbe 100644
--- a/src/content/lib/environment.process.js
+++ b/src/content/lib/environment.process.js
@@ -99,7 +99,8 @@ var ProcessEnvironment = (function() {
     self.addShutdownFunction(Environment.LEVELS.BACKEND,
                              sendShutdownMessageToChildren);
   }
-  ParentProcessEnvironment.prototype = Object.create(ProcessEnvironmentBase.prototype);
+  ParentProcessEnvironment.prototype = Object.create(
+      ProcessEnvironmentBase.prototype);
   ParentProcessEnvironment.prototype.constructor = ProcessEnvironmentBase;
 
   /**
@@ -189,7 +190,8 @@ var ProcessEnvironment = (function() {
 
     childMM.addMessageListener(shutdownMessage, receiveShutdownMessage);
   }
-  ChildProcessEnvironment.prototype = Object.create(ProcessEnvironmentBase.prototype);
+  ChildProcessEnvironment.prototype = Object.create(
+      ProcessEnvironmentBase.prototype);
   ChildProcessEnvironment.prototype.constructor = ProcessEnvironmentBase;
 
   /**
diff --git a/src/content/lib/gui-location.jsm b/src/content/lib/gui-location.jsm
index b62340b..ebf673b 100644
--- a/src/content/lib/gui-location.jsm
+++ b/src/content/lib/gui-location.jsm
@@ -52,8 +52,8 @@ GUILocation.prototype.toString = function() {
 /**
  * @static
  */
-GUILocation.merge = function(guiLocation, location1, location2) {
-  return new guiLocation(
+GUILocation.merge = function(SubclassOfGUILocation, location1, location2) {
+  return new SubclassOfGUILocation(
     location1.value,  // we assume: location1.value == location2.value
     GUILocationProperties.merge(location1.properties, location2.properties));
 };
@@ -67,12 +67,10 @@ GUILocation.existsInArray = function(locationString, locations) {
 
 /**
  * @static
- * @param {String}
- *          locationString The location saved in GUILocation.value
- * @param {String}
- *          locations Array of GUILocation objects
+ * @param {String} locationString The location saved in GUILocation.value
+ * @param {String} locations Array of GUILocation objects
  * @return {int} The index of the first GUILocation object which contains the
- *          specified locationString. If it doesn't exist, it returns -1.
+ *     specified locationString. If it doesn't exist, it returns -1.
  */
 GUILocation.indexOfLocationInArray = function(locationString, locations) {
   if (locationString instanceof GUILocation) {
@@ -95,11 +93,11 @@ GUILocation.sortByNumRequestsCompareFunction = function(a, b) {
   return GUILocation.compareFunction(a, b, "sortByNumRequests");
 };
 GUILocation.compareFunction = function(a, b, sortType) {
-  var a_default = 0 < a.properties.numDefaultPolicyRequests;
-  var b_default = 0 < b.properties.numDefaultPolicyRequests;
+  var aDefault = 0 < a.properties.numDefaultPolicyRequests;
+  var bDefault = 0 < b.properties.numDefaultPolicyRequests;
 
-  if (a_default !== b_default) {
-    if (a_default === true) {
+  if (aDefault !== bDefault) {
+    if (aDefault === true) {
       // default-policy destinations first.
       return -1;
     } else {
@@ -244,9 +242,9 @@ GUILocationProperties.requestCountProperties = [
 ];
 
 /**
- * @static
- *
  * Merge the given GUILocationProperties object to a new object
+ *
+ * @static
  */
 GUILocationProperties.merge = function(prop1, prop2) {
   var requestCountProperties = GUILocationProperties.requestCountProperties;
diff --git a/src/content/lib/manager-for-message-listeners.jsm b/src/content/lib/manager-for-message-listeners.jsm
index 7571596..2e54b48 100644
--- a/src/content/lib/manager-for-message-listeners.jsm
+++ b/src/content/lib/manager-for-message-listeners.jsm
@@ -81,8 +81,8 @@ function ManagerForMessageListeners(aEnv, aMM) {
     // aEnv is not defined! Try to report an error.
     if (!!Logger) {
       Logger.warning(Logger.TYPE_INTERNAL, "No Environment was specified for " +
-                     "a new ManagerForMessageListeners! This means that the listeners " +
-                     "won't be unregistered!");
+        "a new ManagerForMessageListeners! This means that the listeners " +
+        "won't be unregistered!");
     }
   }
 
@@ -112,8 +112,7 @@ ManagerForMessageListeners.prototype.addListener = function(aMessageName,
   let self = this;
   if (typeof aCallback !== "function") {
     Logger.warning(Logger.TYPE_ERROR, "The callback for a message listener" +
-                   "must be a function! The message name was \"" + aMessageName +
-                   "\"");
+        "must be a function! The message name was \"" + aMessageName + "\"");
     return;
   }
   if (aMessageName.indexOf(C.MM_PREFIX) === 0) {
diff --git a/src/content/lib/observer-manager.jsm b/src/content/lib/observer-manager.jsm
index 02fcc82..5d89d5b 100644
--- a/src/content/lib/observer-manager.jsm
+++ b/src/content/lib/observer-manager.jsm
@@ -142,8 +142,9 @@ function ObserverManager(aEnv) {
    * Observe one single subdomain of a Pref Branch (using nsIPrefBranch).
    * Details: https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPrefBranch#addObserver%28%29
    *
-   * @param {string} aTopic - The topic to be observed.
-   * @param {Function} aCallback - The observer's callback function.
+   * @param {nsIPrefBranch} aPrefBranch
+   * @param {String} aDomain
+   * @param {Function} aCallback
    */
   ObserverManager.prototype.observeSinglePrefBranch = function(aPrefBranch,
                                                                aDomain,
diff --git a/src/content/lib/request-processor.redirects.js b/src/content/lib/request-processor.redirects.js
index 4aee21f..f2beec6 100644
--- a/src/content/lib/request-processor.redirects.js
+++ b/src/content/lib/request-processor.redirects.js
@@ -87,8 +87,8 @@ RequestProcessor = (function(self) {
    * Handles observer notifications sent by the HTTPS Everywhere extension
    * that inform us of URIs that extension has rewritten.
    *
-   * @param nsIURI oldURI
-   * @param string newSpec
+   * @param {nsIURI} oldURI
+   * @param {string} newSpec
    */
   function handleHttpsEverywhereUriRewrite(oldURI, newSpec) {
     oldURI = oldURI.QueryInterface(Ci.nsIURI);
diff --git a/src/content/lib/request-set.jsm b/src/content/lib/request-set.jsm
index 8066562..f34e86b 100644
--- a/src/content/lib/request-set.jsm
+++ b/src/content/lib/request-set.jsm
@@ -125,7 +125,9 @@ RequestSet.prototype = {
   },
 
   /**
-   * @param {Array} rules The rules that were triggered by this request.
+   * @param {string} originUri
+   * @param {string} destUri
+   * @param {RequestResult} requestResult
    */
   addRequest: function(originUri, destUri, requestResult) {
     if (requestResult === undefined) {
diff --git a/src/content/lib/request.jsm b/src/content/lib/request.jsm
index 5ff9d4a..d80f61d 100644
--- a/src/content/lib/request.jsm
+++ b/src/content/lib/request.jsm
@@ -222,7 +222,8 @@ NormalRequest.prototype.getContentWindow = function() {
     return null;
   }
 
-  if (context instanceof Ci.nsIDOMXULElement && context.localName === "browser") {
+  if (context instanceof Ci.nsIDOMXULElement &&
+      context.localName === "browser") {
     return context.contentWindow;
   }
 
@@ -262,7 +263,8 @@ NormalRequest.prototype.getChromeWindow = function() {
  */
 NormalRequest.prototype.getBrowser = function() {
   let context = this.aContext;
-  if (context instanceof Ci.nsIDOMXULElement && context.localName === "browser") {
+  if (context instanceof Ci.nsIDOMXULElement &&
+      context.localName === "browser") {
     return context;
   } else {
     return WindowUtils.getBrowserForWindow(this.getContentWindow());
diff --git a/src/content/lib/subscription.jsm b/src/content/lib/subscription.jsm
index fca37d8..06919da 100644
--- a/src/content/lib/subscription.jsm
+++ b/src/content/lib/subscription.jsm
@@ -53,7 +53,9 @@ const SUBSCRIPTION_UPDATED_TOPIC = "rpcontinued-subscription-policy-updated";
 const SUBSCRIPTION_ADDED_TOPIC = "rpcontinued-subscription-policy-added";
 const SUBSCRIPTION_REMOVED_TOPIC = "rpcontinued-subscription-policy-removed";
 
-const DEFAULT_SUBSCRIPTION_LIST_URL_BASE = "https://raw.githubusercontent.com/RequestPolicyContinued/subscriptions/master/";
+const DEFAULT_SUBSCRIPTION_LIST_URL_BASE =
+    "https://raw.githubusercontent.com/" +
+    "RequestPolicyContinued/subscriptions/master/";
 
 const SUBSCRIPTION_UPDATE_SUCCESS = "SUCCESS";
 const SUBSCRIPTION_UPDATE_NOT_NEEDED = "NOT_NEEDED";

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



More information about the Pkg-mozext-commits mailing list