From bcd73659a08fee2a7fdb0ed3893f9f9b8258c273 Mon Sep 17 00:00:00 2001 From: Anant Narayanan Date: Fri, 23 May 2008 11:01:32 -0700 Subject: [PATCH] Correct more syntax errors (super) in trackers.js --- services/sync/modules/trackers.js | 60 ++++++++++++++++--------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/services/sync/modules/trackers.js b/services/sync/modules/trackers.js index cfcefe825658..90f27fa42d93 100644 --- a/services/sync/modules/trackers.js +++ b/services/sync/modules/trackers.js @@ -65,33 +65,33 @@ Function.prototype.async = Async.sugar; * Well not yet, but it will :) */ function Tracker() { - this._init(); + this._init(); } Tracker.prototype = { - _logName: "Tracker", - _score: 0, + _logName: "Tracker", + _score: 0, - _init: function T__init() { - this._log = Log4Moz.Service.getLogger("Service." + this._logName); - this._score = 0; - }, + _init: function T__init() { + this._log = Log4Moz.Service.getLogger("Service." + this._logName); + this._score = 0; + }, - /* Should be called by service periodically - * before deciding which engines to sync - */ - get score() { - if (this._score >= 100) - return 100; - else - return this._score; - }, + /* Should be called by service periodically + * before deciding which engines to sync + */ + get score() { + if (this._score >= 100) + return 100; + else + return this._score; + }, - /* Should be called by service everytime a sync - * has been done for an engine - */ - resetScore: function T_resetScore() { - this._score = 0; - } + /* Should be called by service everytime a sync + * has been done for an engine + */ + resetScore: function T_resetScore() { + this._score = 0; + } }; /* @@ -138,7 +138,9 @@ BookmarksTracker.prototype = { }, _init: function BMT__init() { - super._init(); + this._log = Log4Moz.Service.getLogger("Service." + this._logName); + this._score = 0; + Cc["@mozilla.org/browser/nav-bookmarks-service;1"]. getService(Ci.nsINavBookmarksService). addObserver(this, false); @@ -185,7 +187,9 @@ HistoryTracker.prototype = { }, _init: function HT__init() { - super._init(); + this._log = Log4Moz.Service.getLogger("Service." + this._logName); + this._score = 0; + Cc["@mozilla.org/browser/nav-history-service;1"]. getService(Ci.nsINavHistoryService). addObserver(this, false); @@ -234,7 +238,7 @@ FormsTracker.prototype = { var count = stmnt.getInt32(0); stmnt.reset(); - this._score = abs(this._rowCount - count) * 2; + this._score = Math.abs(this._rowCount - count) * 2; if (this._score >= 100) return 100; @@ -247,12 +251,12 @@ FormsTracker.prototype = { stmnt.executeStep(); this._rowCount = stmnt.getInt32(0); stmnt.reset(); - - super.resetScore(); + this._score = 0; }, _init: function FormsTracker__init() { - super._init(); + this._log = Log4Moz.Service.getLogger("Service." + this._logName); + this._score = 0; var stmnt = this._formDB.createStatement("SELECT COUNT(fieldname) FROM moz_formhistory"); stmnt.executeStep();