[Pkg-mozext-commits] [adblock-plus] 448/464: Backed out changeset 69871d10cf2a

David Prévot taffit at moszumanska.debian.org
Tue Jul 22 20:44:43 UTC 2014


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

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

commit 44d2ae2c67a55bc294945e31c96638215446f3a8
Author: Tom Schuster <tschuster at adblockplus.org>
Date:   Wed Jul 9 21:11:20 2014 +0200

    Backed out changeset 69871d10cf2a
---
 chrome/content/ui/filters-subscriptionactions.js |  2 +-
 chrome/content/ui/progressBar.js                 | 14 ++++----------
 chrome/content/ui/sidebar.js                     |  2 +-
 lib/filterClasses.js                             | 13 +++++++------
 lib/filterStorage.js                             |  4 ++--
 lib/io.js                                        |  5 +++--
 lib/utils.js                                     | 10 +++++-----
 7 files changed, 23 insertions(+), 27 deletions(-)

diff --git a/chrome/content/ui/filters-subscriptionactions.js b/chrome/content/ui/filters-subscriptionactions.js
index 7cedc27..222a4a6 100644
--- a/chrome/content/ui/filters-subscriptionactions.js
+++ b/chrome/content/ui/filters-subscriptionactions.js
@@ -236,7 +236,7 @@ var SubscriptionActions =
       else if (accelKey == Ci.nsIDOMKeyEvent.DOM_VK_ALT)
         result = this._altMask;
     } catch(e) {}
-    Object.defineProperty(this, "_accelMask", {value: result});
+    this.__defineGetter__("_accelMask", function() result);
     return result;
   },
 
diff --git a/chrome/content/ui/progressBar.js b/chrome/content/ui/progressBar.js
index a506c97..659acdd 100644
--- a/chrome/content/ui/progressBar.js
+++ b/chrome/content/ui/progressBar.js
@@ -32,16 +32,10 @@
       canvas.parentNode.appendChild(headers[i]);
 
     // Expose properties
-    Object.defineProperty(progressBar, "activeItem",
-    {
-      get: getActiveItem,
-      set: setActiveItem
-    });
-    Object.defineProperty(progressBar, "activeItemComplete",
-    {
-      get: getActiveItemComplete,
-      set: setActiveItemComplete
-    });
+    progressBar.__defineGetter__("activeItem", getActiveItem);
+    progressBar.__defineSetter__("activeItem", setActiveItem);
+    progressBar.__defineGetter__("activeItemComplete", getActiveItemComplete);
+    progressBar.__defineSetter__("activeItemComplete", setActiveItemComplete);
 
     isRTL = (window.getComputedStyle(document.documentElement).direction == "rtl");
 
diff --git a/chrome/content/ui/sidebar.js b/chrome/content/ui/sidebar.js
index 7694797..92e82ef 100644
--- a/chrome/content/ui/sidebar.js
+++ b/chrome/content/ui/sidebar.js
@@ -85,7 +85,7 @@ function init() {
   }
 
   let {getBrowser, addBrowserLocationListener} = require("appSupport");
-  Object.defineProperty(window, "content", { get: () => getBrowser(mainWin).contentWindow });
+  window.__defineGetter__("content", function() {return getBrowser(mainWin).contentWindow;});
 
   // Initialize matcher for disabled filters
   reloadDisabledFilters();
diff --git a/lib/filterClasses.js b/lib/filterClasses.js
index 2df8781..4572946 100644
--- a/lib/filterClasses.js
+++ b/lib/filterClasses.js
@@ -473,7 +473,7 @@ function RegExpFilter(text, regexpSource, contentType, matchCase, domains, third
   {
     // The filter is a regular expression - convert it immediately to catch syntax errors
     let regexp = new RegExp(regexpSource.substr(1, regexpSource.length - 2), this.matchCase ? "" : "i");
-    Object.defineProperty(this, "regexp", {value: regexp});
+    this.__defineGetter__("regexp", () => regexp);
   }
   else
   {
@@ -529,8 +529,10 @@ RegExpFilter.prototype =
       .replace(/(\.\*)$/, "");     // remove trailing wildcards
 
     let regexp = new RegExp(source, this.matchCase ? "" : "i");
-    Object.defineProperty(this, "regexp", {value: regexp});
-    return regexp;
+
+    delete this.regexpSource;
+    this.__defineGetter__("regexp", () => regexp);
+    return this.regexp;
   },
   /**
    * Content types the filter applies to, combination of values from RegExpFilter.typeMap
@@ -570,10 +572,9 @@ RegExpFilter.prototype =
   }
 };
 
-// Required to optimize Matcher, see also RegExpFilter.prototype.length
-Object.defineProperty(RegExpFilter.prototype, "0",
+RegExpFilter.prototype.__defineGetter__("0", function()
 {
-  get: function() { return this; }
+  return this;
 });
 
 /**
diff --git a/lib/filterStorage.js b/lib/filterStorage.js
index 4985f4e..f263a68 100644
--- a/lib/filterStorage.js
+++ b/lib/filterStorage.js
@@ -85,8 +85,8 @@ let FilterStorage = exports.FilterStorage =
     if (!file)
       Cu.reportError("Adblock Plus: Failed to resolve filter file location from extensions.adblockplus.patternsfile preference");
 
-    Object.defineProperty(this, "sourceFile", {value: file});
-    return file;
+    this.__defineGetter__("sourceFile", () => file);
+    return this.sourceFile;
   },
 
   /**
diff --git a/lib/io.js b/lib/io.js
index 915b5c1..ea362b7 100644
--- a/lib/io.js
+++ b/lib/io.js
@@ -39,8 +39,9 @@ let IO = exports.IO =
   get lineBreak()
   {
     let lineBreak = (Services.appinfo.OS == "WINNT" ? "\r\n" : "\n");
-    Object.defineProperty(this, "lineBreak", {value: lineBreak});
-    return lineBreak;
+    delete IO.lineBreak;
+    IO.__defineGetter__("lineBreak", () => lineBreak);
+    return IO.lineBreak;
   },
 
   /**
diff --git a/lib/utils.js b/lib/utils.js
index 20e613c..b827f90 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -55,7 +55,7 @@ let Utils = exports.Utils =
   {
     let {application} = require("info");
     let result = (application == "fennec" || application == "fennec2");
-    Object.defineProperty(this, "isFennec", {value: result});
+    Utils.__defineGetter__("isFennec", () => result);
     return result;
   },
 
@@ -73,8 +73,8 @@ let Utils = exports.Utils =
     {
       Cu.reportError(e);
     }
-    Object.defineProperty(this, "appLocale", {value: locale});
-    return locale;
+    Utils.__defineGetter__("appLocale", () => locale);
+    return Utils.appLocale;
   },
 
   /**
@@ -83,8 +83,8 @@ let Utils = exports.Utils =
   get platformVersion()
   {
     let platformVersion = Services.appinfo.platformVersion;
-    Object.defineProperty(this, "platformVersion", {value: platformVersion});
-    return platformVersion;
+    Utils.__defineGetter__("platformVersion", () => platformVersion);
+    return Utils.platformVersion;
   },
 
   /**

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