[Pkg-mozext-commits] [requestpolicy] 29/100: [refactoring] replace non-standard __defineGetter__()

David Prévot taffit at moszumanska.debian.org
Fri Dec 12 22:56:52 UTC 2014


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

taffit pushed a commit to branch master
in repository requestpolicy.

commit 5047e592d94cc9423b797a80a81c0de914037d8e
Author: myrdd <myrdd at users.noreply.github.com>
Date:   Tue Sep 16 18:01:26 2014 +0200

    [refactoring] replace non-standard __defineGetter__()
---
 src/content/requestLogTreeView.js | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/content/requestLogTreeView.js b/src/content/requestLogTreeView.js
index 9047917..cb218f5 100644
--- a/src/content/requestLogTreeView.js
+++ b/src/content/requestLogTreeView.js
@@ -52,7 +52,7 @@ requestpolicy.requestLogTreeView = {
   },
 
   clear : function(e) {
-    var count = this._getRowCount();
+    var count = this.rowCount;
     if (count == 0) {
       return;
     }
@@ -108,16 +108,27 @@ requestpolicy.requestLogTreeView = {
   },
 
   // Start of interface.
+  // see https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Tutorial/Custom_Tree_Views
 
-  // rowCount --- we define _getRowCount() as an (old-style) getter for this.
-  _getRowCount : function() {
+  /**
+   * "This property should be set to the total number of rows in the tree."
+   * (getter function)
+   */
+  get rowCount () {
     return this._visibleData.length;
   },
 
+  /**
+   * "This method should return the text contents at the specified row and
+   * column."
+   */
   setTree : function(_treebox) {
     this._treebox = _treebox;
   },
 
+  /**
+   * This method is called once to set the tree element on the view.
+   */
   getCellText : function(index, column) {
     // Row 0 is actually the last element in the array so that we don't have to
     // unshift() the array and can just push().
@@ -231,10 +242,6 @@ requestpolicy.requestLogTreeView = {
 
 };
 
-requestpolicy.requestLogTreeView.__defineGetter__("rowCount", function() {
-      return this._getRowCount();
-    });
-
 // Initialize when the window DOM is loaded.
 addEventListener("load", function(event) {
       requestpolicy.requestLogTreeView.init();

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