[Pkg-mozext-commits] [personasplus] 20/76: Remove Deprecated Expresion Closures

David Prévot taffit at moszumanska.debian.org
Fri Aug 4 21:45:03 UTC 2017


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

taffit pushed a commit to branch master
in repository personasplus.

commit ca64e2081702d01e5958db8d8bcf40e9760b8516
Author: Baris Derin <baris at barisderin.com>
Date:   Wed Aug 10 08:33:30 2016 +0300

    Remove Deprecated Expresion Closures
    
    Remove Deprecated Expresion Closures
---
 extension/modules/Observers.js    |  2 +-
 extension/modules/Preferences.js  |  4 ++--
 extension/modules/StringBundle.js |  2 +-
 extension/modules/log4moz.js      |  2 +-
 extension/modules/personas.js     |  4 ++--
 extension/modules/service.js      | 12 ++++++------
 6 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/extension/modules/Observers.js b/extension/modules/Observers.js
index bfec415..b48048d 100644
--- a/extension/modules/Observers.js
+++ b/extension/modules/Observers.js
@@ -91,7 +91,7 @@ var Observers = {
     // we can make it.  We could index by topic, but we can't index by callback
     // or thisObject, as far as I know, since the keys to JavaScript hashes
     // (a.k.a. objects) can apparently only be primitive values.
-    let [observer] = cache.filter(function(v) v.topic      == topic    &&
+    let [observer] = cache.filter( v => v.topic      == topic    &&
                                               v.callback   == callback &&
                                               v.thisObject == thisObject);
     if (observer) {
diff --git a/extension/modules/Preferences.js b/extension/modules/Preferences.js
index 09ceb0f..08f387d 100644
--- a/extension/modules/Preferences.js
+++ b/extension/modules/Preferences.js
@@ -70,7 +70,7 @@ Preferences.prototype = {
    */
   get: function(prefName, defaultValue) {
     if (isArray(prefName))
-      return prefName.map(function(v) this.get(v, defaultValue), this);
+      return prefName.map( v => this.get(v, defaultValue), this);
 
     switch (this._prefSvc.getPrefType(prefName)) {
       case Ci.nsIPrefBranch.PREF_STRING:
@@ -337,7 +337,7 @@ Preferences.prototype = {
     // make it.  We could index by fullBranch, but we can't index by callback
     // or thisObject, as far as I know, since the keys to JavaScript hashes
     // (a.k.a. objects) can apparently only be primitive values.
-    let [observer] = observers.filter(function(v) v.prefName   == fullPrefName &&
+    let [observer] = observers.filter( v => v.prefName   == fullPrefName &&
                                                   v.callback   == callback &&
                                                   v.thisObject == thisObject);
 
diff --git a/extension/modules/StringBundle.js b/extension/modules/StringBundle.js
index 7f6c629..9328314 100644
--- a/extension/modules/StringBundle.js
+++ b/extension/modules/StringBundle.js
@@ -95,7 +95,7 @@ StringBundle.prototype = {
     let stringBundle = Cc["@mozilla.org/intl/stringbundle;1"].
                        getService(Ci.nsIStringBundleService).
                        createBundle(this.url, this._appLocale);
-    this.__defineGetter__("_stringBundle", function() stringBundle);
+    this.__defineGetter__("_stringBundle", () => stringBundle);
     return this._stringBundle;
   },
 
diff --git a/extension/modules/log4moz.js b/extension/modules/log4moz.js
index 7c1d421..7ebc1e8 100644
--- a/extension/modules/log4moz.js
+++ b/extension/modules/log4moz.js
@@ -198,7 +198,7 @@ Logger.prototype = {
   },
 
   _parent: null,
-  get parent() this._parent,
+  get parent() {return this._parent;},
   set parent(parent) {
     if (this._parent == parent) {
       return;
diff --git a/extension/modules/personas.js b/extension/modules/personas.js
index 9996ec0..3950aa8 100644
--- a/extension/modules/personas.js
+++ b/extension/modules/personas.js
@@ -177,7 +177,7 @@ var PersonaController = {
      * Escape CSS special characters in unquoted URLs,
      * per http://www.w3.org/TR/CSS21/syndata.html#uri.
      */
-    _escapeURLForCSS: function(url) url.replace(/[(),\s'"]/g, "\$&"),
+    _escapeURLForCSS: url => url.replace(/[(),\s'"]/g, "\$&"),
 
     openURLInTab: function(url, event) {
         var document = event.currentTarget.ownerDocument;
@@ -899,7 +899,7 @@ var PersonaController = {
     _authorizeHost: function(aEvent) {
         let host = aEvent.target.ownerDocument.location.hostname;
         let authorizedHosts = this._prefs.get("authorizedHosts").split(/[, ]+/);
-        if (!authorizedHosts.some(function(v) v == host))
+        if (!authorizedHosts.some( v => v == host))
             throw host + " not authorized to modify personas";
     },
 
diff --git a/extension/modules/service.js b/extension/modules/service.js
index 90c9688..586d8ea 100644
--- a/extension/modules/service.js
+++ b/extension/modules/service.js
@@ -454,7 +454,7 @@ var PersonaService = {
 
         try {
             var json = JSON.parse(request.responseText)
-                .addons.filter(function(a) a.theme);
+                .addons.filter( a => a.theme);
         } catch (ex) {
             this._log.debug("error parsing favorites data: " + request.responseText.slice(0, 100) + "...");
             return;
@@ -602,7 +602,7 @@ var PersonaService = {
     // The JSON feed of favorite personas retrieved from the server.
     _favorites: null,
 
-    get favorites() this._favorites,
+    get favorites() {return this._favorites;},
     set favorites(val) {
         this._favorites = val;
 
@@ -762,9 +762,9 @@ var PersonaService = {
         let recent = this.getRecentPersonas();
         let favorites = this.favorites;
         let inRecent =
-            (recent && recent.some(function(v) v.id == persona.id));
+            (recent && recent.some( v => v.id == persona.id));
         let inFavorites =
-            (favorites && favorites.some(function(v) v.id == persona.id));
+            (favorites && favorites.some( v => v.id == persona.id));
 
         this.currentPersona = persona;
         this._addPersonaToRecent(persona);
@@ -954,7 +954,7 @@ var PersonaService = {
         // to appear twice on the list).  Afterwards, we'll add the recent persona
         // to the list in a way that makes it the most recent one.
         if (persona.id)
-            personas = personas.filter(function(v) !v.id || v.id != persona.id);
+            personas = personas.filter( v => !v.id || v.id != persona.id);
 
         // Make the new persona the most recent one.
         personas.unshift(persona);
@@ -1051,7 +1051,7 @@ var PersonaService = {
             let cookieHost = cookie.host.replace(/^\./, "");
 
             if (cookie.name == COOKIE_INITIAL_PERSONA &&
-                authorizedHosts.some(function(v) v == cookieHost)) {
+                authorizedHosts.some( v => v == cookieHost)) {
 
                 // There could be more than one "initial_persona" cookie. The cookie
                 // with latest expiration time is selected.

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



More information about the Pkg-mozext-commits mailing list