fix some variable references to use a local var instead of a closure
authorDan Mills <thunder@mozilla.com>
Thu, 18 Dec 2008 01:11:03 -0800
changeset 45110 1ca4c32b3999858df7369e592a5b3ff42ac4cbde
parent 45109 bc0cf14b1501c11d6229d1ef329c994f916ebbba
child 45111 67a01d0b1f7f5db36c972d25679885dd1a6b8571
child 45112 82067c9e86841a1e9e48fc67020f0a12e784f37a
push idunknown
push userunknown
push dateunknown
fix some variable references to use a local var instead of a closure
services/sync/modules/stores.js
--- a/services/sync/modules/stores.js
+++ b/services/sync/modules/stores.js
@@ -82,22 +82,22 @@ Store.prototype = {
 
   _init: function Store__init() {
     this._log = Log4Moz.repository.getLogger("Store." + this._logName);
   },
 
   applyIncoming: function BStore_applyIncoming(onComplete, record) {
     let fn = function(rec) {
       let self = yield;
-      if (!record.cleartext)
-        this.remove(record);
-      else if (!this.itemExists(record.id))
-        this.create(record);
+      if (!rec.cleartext)
+        this.remove(rec);
+      else if (!this.itemExists(rec.id))
+        this.create(rec);
       else
-        this.update(record);
+        this.update(rec);
     };
     fn.async(this, onComplete, record);
   },
 
   itemExists: function Store_itemExists(id) {
     if (!this._itemCache)
       return this._itemExists(id);