[Pkg-mozext-commits] [adblock-plus] 04/74: Issue 1602 - Use ES6 generators instead of legacy generators

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 12:07:04 UTC 2015


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

taffit pushed a commit to branch master
in repository adblock-plus.

commit 9362c4ba07d358c08b9edd38c3af3f236bb83e28
Author: Sebastian Noack <sebastian at adblockplus.org>
Date:   Tue Mar 31 19:43:11 2015 +0200

    Issue 1602 - Use ES6 generators instead of legacy generators
---
 chrome/content/ui/filters-backup.js |  2 +-
 lib/elemHide.js                     |  2 +-
 lib/filterStorage.js                |  2 +-
 lib/io.js                           |  4 ++--
 lib/notification.js                 |  2 +-
 lib/synchronizer.js                 |  2 +-
 lib/ui.js                           | 16 +++++++++++-----
 metadata.gecko                      | 10 +++++-----
 8 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/chrome/content/ui/filters-backup.js b/chrome/content/ui/filters-backup.js
index 9232b5f..d060cec 100644
--- a/chrome/content/ui/filters-backup.js
+++ b/chrome/content/ui/filters-backup.js
@@ -325,7 +325,7 @@ var Backup =
     if (checksum)
       list.splice(1, 0, "! Checksum: " + checksum);
 
-    function generator()
+    function* generator()
     {
       for (let i = 0; i < list.length; i++)
         yield list[i];
diff --git a/lib/elemHide.js b/lib/elemHide.js
index b762040..7e402c9 100644
--- a/lib/elemHide.js
+++ b/lib/elemHide.js
@@ -282,7 +282,7 @@ let ElemHide = exports.ElemHide =
     this._applying = true;
   },
 
-  _generateCSSContent: function()
+  _generateCSSContent: function*()
   {
     // Grouping selectors by domains
     let domains = Object.create(null);
diff --git a/lib/filterStorage.js b/lib/filterStorage.js
index dd8aea7..0e45140 100644
--- a/lib/filterStorage.js
+++ b/lib/filterStorage.js
@@ -476,7 +476,7 @@ let FilterStorage = exports.FilterStorage =
     }
   },
 
-  _generateFilterData: function(subscriptions)
+  _generateFilterData: function*(subscriptions)
   {
     yield "# Adblock Plus preferences";
     yield "version=" + formatVersion;
diff --git a/lib/io.js b/lib/io.js
index 5e60b54..9c500b7 100644
--- a/lib/io.js
+++ b/lib/io.js
@@ -69,7 +69,7 @@ let IO = exports.IO =
    * each line read and with a null parameter once the read operation is done.
    * The callback will be called when the operation is done.
    */
-  readFromFile: function(/**nsIFile*/ file, /**Object*/ listener, /**Function*/ callback)
+  readFromFile: function*(/**nsIFile*/ file, /**Object*/ listener, /**Function*/ callback)
   {
     try
     {
@@ -194,7 +194,7 @@ let IO = exports.IO =
    * Writes string data to a file in UTF-8 format asynchronously. The callback
    * will be called when the write operation is done.
    */
-  writeToFile: function(/**nsIFile*/ file, /**Iterator*/ data, /**Function*/ callback)
+  writeToFile: function*(/**nsIFile*/ file, /**Iterator*/ data, /**Function*/ callback)
   {
     try
     {
diff --git a/lib/notification.js b/lib/notification.js
index 1fa8eed..dc1e98b 100644
--- a/lib/notification.js
+++ b/lib/notification.js
@@ -94,7 +94,7 @@ let Notification = exports.Notification =
   /**
    * Yields a Downloadable instances for the notifications download.
    */
-  _getDownloadables: function()
+  _getDownloadables: function*()
   {
     let downloadable = new Downloadable(Prefs.notificationurl);
     if (typeof Prefs.notificationdata.lastError === "number")
diff --git a/lib/synchronizer.js b/lib/synchronizer.js
index 0a7a1e8..f0d3e72 100644
--- a/lib/synchronizer.js
+++ b/lib/synchronizer.js
@@ -88,7 +88,7 @@ let Synchronizer = exports.Synchronizer =
   /**
    * Yields Downloadable instances for all subscriptions that can be downloaded.
    */
-  _getDownloadables: function()
+  _getDownloadables: function*()
   {
     if (!Prefs.subscriptions_autoupdate)
       return;
diff --git a/lib/ui.js b/lib/ui.js
index db1f05b..32c5af4 100644
--- a/lib/ui.js
+++ b/lib/ui.js
@@ -657,12 +657,18 @@ let UI = exports.UI =
       // On Linux the list returned will be empty, see bug 156333. Fall back to random order.
       enumerator = Services.wm.getEnumerator(null);
     }
-    while (enumerator.hasMoreElements())
+
+    let generate = function*()
     {
-      let window = enumerator.getNext().QueryInterface(Ci.nsIDOMWindow);
-      if (isKnownWindow(window))
-        yield window;
-    }
+      while (enumerator.hasMoreElements())
+      {
+        let window = enumerator.getNext().QueryInterface(Ci.nsIDOMWindow);
+        if (isKnownWindow(window))
+          yield window;
+      }
+    };
+
+    return generate();
   },
 
   /**
diff --git a/metadata.gecko b/metadata.gecko
index 9ee226b..068f4ad 100644
--- a/metadata.gecko
+++ b/metadata.gecko
@@ -29,11 +29,11 @@ zh-CN=https://adblockplus.org/zh_CN/
 zh-TW=https://adblockplus.org/zh_TW/
 
 [compat]
-firefox=26.0/39.0
-fennec2=26.0/39.0
-thunderbird=26.0/39.0
-seamonkey=2.23/2.36
-toolkit=26.0/39.0
+firefox=29.0/39.0
+fennec2=29.0/39.0
+thunderbird=29.0/39.0
+seamonkey=2.26/2.36
+toolkit=29.0/39.0
 
 [mapping]
 chrome/content/ui/firstRun.html = adblockplusui/firstRun.html

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



More information about the Pkg-mozext-commits mailing list