[Pkg-mozext-commits] [requestpolicy] 217/257: Revert "[ref] Ruleset.getHostMatches: convert to generator function"

David Prévot taffit at moszumanska.debian.org
Thu Jan 28 03:20:15 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 3e67794f06934812f2ecf23be06a8d73200fbb36
Author: Martin Kimmerle <dev at 256k.de>
Date:   Tue Dec 15 18:32:31 2015 +0100

    Revert "[ref] Ruleset.getHostMatches: convert to generator function"
    
    This reverts commit 41fd1c124c2f77398f145e6f68f5eb80afde7aec.
---
 src/content/lib/ruleset.jsm | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/content/lib/ruleset.jsm b/src/content/lib/ruleset.jsm
index b659165..9c143a1 100644
--- a/src/content/lib/ruleset.jsm
+++ b/src/content/lib/ruleset.jsm
@@ -905,9 +905,16 @@ Ruleset.prototype = {
    * objects. For domains, this is in top-down order. For
    * example, first "com", then "foo", then "www".
    *
+   * FIXME: Again apply commit 41fd1c1,
+   * "[ref] Ruleset.getHostMatches: convert to generator function".
+   * as soon as Pale Moon supports Generator Functions.
+   * Note: JSCS currently crashes here, because it does not support
+   * SpiderMonkey's Legacy generator function,
+   * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/Legacy_generator_function
+   *
    * @param {string} host The host to get matching entries for.
    */
-  getHostMatches: function*(host) {
+  getHostMatches: function(host) {
     if (!this.rules.isEmpty()) {
       // If `this.rules` is not empty, it contains any rules which do
       // not specify a host (host = undefined).
@@ -973,7 +980,7 @@ Ruleset.prototype = {
 
     //dprint("Checking origin rules and origin-to-destination rules.");
     // First, check for rules for each part of the origin host.
-    originouterloop: for (let entry of this.getHostMatches(originHost)) {
+    originouterloop: for (let entry in this.getHostMatches(originHost)) {
       //dprint(entry);
       for (let rule in entry.rules) {
         //dprint("Checking rule: " + rule);
@@ -1007,7 +1014,7 @@ Ruleset.prototype = {
         // entry we're currently looking at.
         if (ruleMatchedOrigin && rule.destinations) {
           //dprint("There are origin-to-destination rules using this origin rule.");
-          for (let destEntry of rule.destinations.getHostMatches(destHost)) {
+          for (let destEntry in rule.destinations.getHostMatches(destHost)) {
             //dprint(destEntry);
             for (let destRule in destEntry.rules) {
               //dprint("Checking rule: " + rule);
@@ -1057,7 +1064,7 @@ Ruleset.prototype = {
 
     //dprint("Checking dest rules.");
     // Last, check for rules for each part of the destination host.
-    destouterloop: for (let entry of this.getHostMatches(destHost)) {
+    destouterloop: for (let entry in this.getHostMatches(destHost)) {
       //dprint(entry);
       for (let rule in entry.rules) {
         //dprint("Checking rule: " + rule);

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