add depth and sortindex getters, and a toString for nicer printing
authorDan Mills <thunder@mozilla.com>
Tue, 23 Dec 2008 11:20:20 -0800
changeset 45131 634eac01828e699160d938f8dbe76e788133be08
parent 45130 b8d1e4d0b3d221427f53780c2d5d06476bcbc521
child 45132 13213ab2945d5a5032760adb9b5a59cb50bcd9a9
push idunknown
push userunknown
push dateunknown
add depth and sortindex getters, and a toString for nicer printing
services/sync/modules/base_records/wbo.js
--- a/services/sync/modules/base_records/wbo.js
+++ b/services/sync/modules/base_records/wbo.js
@@ -76,19 +76,35 @@ WBORecord.prototype = {
     this.data.parentid = value;
   },
 
   get modified() this.data.modified,
   set modified(value) {
     this.data.modified = value;
   },
 
+  get depth() this.data.depth,
+  set depth(value) {
+    this.data.depth = value;
+  },
+
+  get sortindex() this.data.sortindex,
+  set sortindex(value) {
+    this.data.sortindex = value;
+  },
+
   get payload() this.data.payload,
   set payload(value) {
     this.data.payload = value;
+  },
+
+  toString: function WBORec_toString() {
+    return "{id: " + this.id + ", depth: " + this.depth +
+      ", sortindex: " + this.sortindex + ",\nmodified: " + this.modified +
+      ", payload: " + json.encode(this.cleartext) + "}";
   }
 };
 
 // fixme: global, ugh
 let json = Cc["@mozilla.org/dom/json;1"].createInstance(Ci.nsIJSON);
 
 function WBOFilter() {}
 WBOFilter.prototype = {