Bug 1602423 - Remove xpidl [array] use in calIRecurrenceInfo. r=darktrojan
authorBen Campbell <benc@thunderbird.net>
Sun, 05 Jan 2020 12:53:28 +0200
changeset 37859 d0bcd93317f907d7475f2722846af5c9ecf333f1
parent 37858 1f8ec0da7271b230c9e4a088207e275bfa92a6f1
child 37860 2e4a2383f3182d3befbcee92c0ef2ba7347eb23d
push id397
push userclokep@gmail.com
push dateMon, 10 Feb 2020 21:16:13 +0000
reviewersdarktrojan
bugs1602423
Bug 1602423 - Remove xpidl [array] use in calIRecurrenceInfo. r=darktrojan DONTBUILD
calendar/base/content/calendar-invitations-manager.js
calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
calendar/base/modules/calRecurrenceUtils.jsm
calendar/base/modules/utils/calIteratorUtils.jsm
calendar/base/modules/utils/calItipUtils.jsm
calendar/base/public/calIRecurrenceInfo.idl
calendar/base/src/calAlarmService.js
calendar/base/src/calFilter.js
calendar/base/src/calItemBase.js
calendar/base/src/calRecurrenceInfo.js
calendar/lightning/content/lightning-item-iframe.js
calendar/lightning/modules/ltnInvitationUtils.jsm
calendar/providers/memory/calMemoryCalendar.js
calendar/providers/storage/calStorageCalendar.js
calendar/test/unit/test_bug343792.js
calendar/test/unit/test_bug356207.js
calendar/test/unit/test_ics_parser.js
calendar/test/unit/test_recur.js
calendar/test/unit/test_storage.js
--- a/calendar/base/content/calendar-invitations-manager.js
+++ b/calendar/base/content/calendar-invitations-manager.js
@@ -324,17 +324,17 @@ InvitationsManager.prototype = {
    * XXXdbo       Please document these correctly.
    *
    * @param item      The item to add.
    */
   addItem: function(item) {
     let recInfo = item.recurrenceInfo;
     if (recInfo && !cal.itip.isOpenInvitation(item)) {
       // scan exceptions:
-      let ids = recInfo.getExceptionIds({});
+      let ids = recInfo.getExceptionIds();
       for (let id of ids) {
         let ex = recInfo.getExceptionFor(id);
         if (ex && this.validateItem(ex) && !this.hasItem(ex)) {
           this.mItemList.push(ex);
         }
       }
     } else if (this.validateItem(item) && !this.hasItem(item)) {
       this.mItemList.push(item);
--- a/calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
@@ -164,17 +164,17 @@ const RecurrencePreview = {
         minimonth.showMonth(cal.dtz.dateTimeToJsDate(start));
         if (recurrenceInfo) {
           // retrieve an array of dates that represents all occurrences
           // that fall into this time interval [start,end[.
           // note: the following loop assumes that this array contains
           // dates that are strictly monotonically increasing.
           // should getOccurrenceDates() not enforce this assumption we
           // need to fall back to some different algorithm.
-          let dates = recurrenceInfo.getOccurrenceDates(start, end, 0, {});
+          let dates = recurrenceInfo.getOccurrenceDates(start, end, 0);
 
           // now run through all days of this month and set the
           // 'busy' attribute with respect to the occurrence array.
           let index = 0;
           let occurrence = null;
           if (index < dates.length) {
             occurrence = dates[index++].getInTimezone(start.timezone);
           }
--- a/calendar/base/modules/calRecurrenceUtils.jsm
+++ b/calendar/base/modules/calRecurrenceUtils.jsm
@@ -377,17 +377,17 @@ function recurrenceRule2String(recurrenc
 /**
  * Split rules into negative and positive rules.
  *
  * @param recurrenceInfo    An item's recurrence info to parse.
  * @return                  An array with two elements: an array of positive
  *                            rules and an array of negative rules.
  */
 function splitRecurrenceRules(recurrenceInfo) {
-  let ritems = recurrenceInfo.getRecurrenceItems({});
+  let ritems = recurrenceInfo.getRecurrenceItems();
   let rules = [];
   let exceptions = [];
   for (let ritem of ritems) {
     if (ritem.isNegative) {
       exceptions.push(ritem);
     } else {
       rules.push(ritem);
     }
@@ -424,48 +424,48 @@ function checkRecurrenceRule(aRule, aArr
  */
 function countOccurrences(aItem) {
   let occCounter = null;
   let recInfo = aItem.parentItem.recurrenceInfo;
   if (recInfo && recInfo.isFinite) {
     occCounter = 0;
     let excCounter = 0;
     let byCount = false;
-    let ritems = recInfo.getRecurrenceItems({});
+    let ritems = recInfo.getRecurrenceItems();
     for (let ritem of ritems) {
       if (ritem instanceof Ci.calIRecurrenceRule) {
         if (ritem.isByCount) {
           occCounter = occCounter + ritem.count;
           byCount = true;
         } else {
           // the rule is limited by as an until date
           let from = aItem.parentItem.startDate.clone();
           let until = aItem.parentItem.endDate.clone();
           if (until.compare(ritem.untilDate) == -1) {
             until = ritem.untilDate.clone();
           }
 
-          let exceptionIds = recInfo.getExceptionIds({});
+          let exceptionIds = recInfo.getExceptionIds();
           for (let exceptionId of exceptionIds) {
             let recur = recInfo.getExceptionFor(exceptionId);
             recur.QueryInterface(Ci.calIEvent);
             if (from.compare(recur.startDate) == 1) {
               from = recur.startDate.clone();
             }
             if (until.compare(recur.endDate) == -1) {
               until = recur.endDate.clone();
             }
           }
 
           // we add an extra day at beginning and end, so we don't
           // need to take care of any timezone conversion
           from.addDuration(cal.createDuration("-P1D"));
           until.addDuration(cal.createDuration("P1D"));
 
-          let occurrences = recInfo.getOccurrences(from, until, 0, {});
+          let occurrences = recInfo.getOccurrences(from, until, 0);
           occCounter = occCounter + occurrences.length;
         }
       } else if (ritem instanceof Ci.calIRecurrenceDate) {
         if (ritem.isNegative) {
           // this is an exdate
           excCounter++;
         } else {
           // this is an (additional) rdate
--- a/calendar/base/modules/utils/calIteratorUtils.jsm
+++ b/calendar/base/modules/utils/calIteratorUtils.jsm
@@ -24,17 +24,17 @@ var caliterate = {
    * @param {calIItemBase[]} items        array of items to iterate
    * @yields {calIItemBase}
    */
   items: function*(items) {
     for (let item of items) {
       yield item;
       let rec = item.recurrenceInfo;
       if (rec) {
-        for (let exid of rec.getExceptionIds({})) {
+        for (let exid of rec.getExceptionIds()) {
           yield rec.getExceptionFor(exid);
         }
       }
     }
   },
 
   /**
    * Runs the body() function once for each item in the iterator using the event queue to make
--- a/calendar/base/modules/utils/calItipUtils.jsm
+++ b/calendar/base/modules/utils/calItipUtils.jsm
@@ -746,22 +746,22 @@ var calitip = {
           return;
         }
       }
 
       if (aOriginalItem.recurrenceInfo && aItem.recurrenceInfo) {
         // check whether the two differ only in EXDATEs
         let clonedItem = aItem.clone();
         let exdates = [];
-        for (let ritem of clonedItem.recurrenceInfo.getRecurrenceItems({})) {
+        for (let ritem of clonedItem.recurrenceInfo.getRecurrenceItems()) {
           let wrappedRItem = cal.wrapInstance(ritem, Ci.calIRecurrenceDate);
           if (
             ritem.isNegative &&
             wrappedRItem &&
-            !aOriginalItem.recurrenceInfo.getRecurrenceItems({}).some(recitem => {
+            !aOriginalItem.recurrenceInfo.getRecurrenceItems().some(recitem => {
               let wrappedR = cal.wrapInstance(recitem, Ci.calIRecurrenceDate);
               return (
                 recitem.isNegative && wrappedR && wrappedR.date.compare(wrappedRItem.date) == 0
               );
             })
           ) {
             exdates.push(wrappedRItem);
           }
@@ -1372,17 +1372,17 @@ function updateItem(item, itipItemItem) 
   let newItem = item.clone();
   newItem.icalComponent = itipItemItem.icalComponent;
   setReceivedInfo(newItem, itipItemItem);
   updateUserData(newItem, item);
 
   let recInfo = itipItemItem.recurrenceInfo;
   if (recInfo) {
     // keep care of installing all overridden items, and mind existing alarms, categories:
-    for (let rid of recInfo.getExceptionIds({})) {
+    for (let rid of recInfo.getExceptionIds()) {
       let excItem = recInfo.getExceptionFor(rid).clone();
       cal.ASSERT(excItem, "unexpected!");
       let newExc = newItem.recurrenceInfo.getOccurrenceFor(rid).clone();
       newExc.icalComponent = excItem.icalComponent;
       setReceivedInfo(newExc, itipItemItem);
       let existingExcItem = item.recurrenceInfo && item.recurrenceInfo.getExceptionFor(rid);
       if (existingExcItem) {
         updateUserData(newExc, existingExcItem);
--- a/calendar/base/public/calIRecurrenceInfo.idl
+++ b/calendar/base/public/calIRecurrenceInfo.idl
@@ -47,22 +47,21 @@ interface calIRecurrenceInfo : nsISuppor
 
   /**
    * The end point of the last occurrence, to avoid calculating occurrences for
    * items that have finished recurring. If the object is mutable, or the
    * recurrence is not finite, this value is the maximum possible PRTime.
    */
   readonly attribute PRTime recurrenceEndDate;
 
-  /*
+  Array<calIRecurrenceItem> getRecurrenceItems();
+  /**
    * Set of recurrence items; the order of these matters.
    */
-
-  void getRecurrenceItems(out unsigned long aCount, [array,size_is(aCount),retval] out calIRecurrenceItem aItems);
-  void setRecurrenceItems(in unsigned long aCount, [array,size_is(aCount)] in calIRecurrenceItem aItems);
+  void setRecurrenceItems(in Array<calIRecurrenceItem> aItems);
 
   unsigned long countRecurrenceItems();
   void clearRecurrenceItems();
   void appendRecurrenceItem(in calIRecurrenceItem aItem);
 
   calIRecurrenceItem getRecurrenceItemAt(in unsigned long aIndex);
   void deleteRecurrenceItemAt(in unsigned long aIndex);
   void deleteRecurrenceItem(in calIRecurrenceItem aItem);
@@ -112,17 +111,17 @@ interface calIRecurrenceInfo : nsISuppor
    * Removes an exception item for the given recurrence ID, if
    * any exist.
    */
   void removeExceptionFor(in calIDateTime aRecurrenceId);
 
   /**
    * Returns a list of all recurrence ids that have exceptions.
    */
-  void getExceptionIds(out unsigned long aCount, [array,size_is(aCount),retval] out calIDateTime aIds);
+  Array<calIDateTime> getExceptionIds();
 
   /*
    * Recurrence calculation
    */
 
   /*
    * Get the occurrence at the given recurrence ID; if there is no
    * exception, then create a new proxy object with the normal occurrence.
@@ -158,30 +157,28 @@ interface calIRecurrenceInfo : nsISuppor
    *
    * @param aRangeStart     The (inclusive) date to start searching.
    * @param aRangeEnd       The (exclusive) date to end searching.
    * @param aMaxCount       The maximum number of dates to return
    *
    * @param aCount          The number of dates returned.
    * @return                The array of dates.
    */
-  void getOccurrenceDates(in calIDateTime aRangeStart,
-                          in calIDateTime aRangeEnd,
-                          in unsigned long aMaxCount,
-                          out unsigned long aCount, [array,size_is(aCount),retval] out calIDateTime aDates);
+  Array<calIDateTime> getOccurrenceDates(in calIDateTime aRangeStart,
+                                         in calIDateTime aRangeEnd,
+                                         in unsigned long aMaxCount);
 
   /**
    * Return an array of calIItemBase representing all occurrences of this event
    * between start (inclusive) and end (non-inclusive). Exceptions are taken
    * into account.
    *
    * @param aRangeStart     The (inclusive) date to start searching.
    * @param aRangeEnd       The (exclusive) date to end searching.
    * @param aMaxCount       The maximum number of occurrences to return
    *
    * @param aCount          The number of occurrences returned.
    * @return                The array of occurrences.
    */
-  void getOccurrences(in calIDateTime aRangeStart,
-                       in calIDateTime aRangeEnd,
-                       in unsigned long aMaxCount,
-                       out unsigned long aCount, [array,size_is(aCount),retval] out calIItemBase aItems);
+  Array<calIItemBase> getOccurrences(in calIDateTime aRangeStart,
+                                     in calIDateTime aRangeEnd,
+                                     in unsigned long aMaxCount);
 };
--- a/calendar/base/src/calAlarmService.js
+++ b/calendar/base/src/calAlarmService.js
@@ -408,17 +408,17 @@ calAlarmService.prototype = {
 
   getOccurrencesInRange: function(aItem) {
     // We search 1 month in each direction for alarms.  Therefore,
     // we need occurrences between initial start date and 1 month from now
     let until = nowUTC();
     until.month += 1;
 
     if (aItem && aItem.recurrenceInfo) {
-      return aItem.recurrenceInfo.getOccurrences(this.mRangeStart, until, 0, {});
+      return aItem.recurrenceInfo.getOccurrences(this.mRangeStart, until, 0);
     } else {
       return cal.item.checkIfInRange(aItem, this.mRangeStart, until) ? [aItem] : [];
     }
   },
 
   addAlarmsForOccurrences: function(aParentItem) {
     let occs = this.getOccurrencesInRange(aParentItem);
 
--- a/calendar/base/src/calFilter.js
+++ b/calendar/base/src/calFilter.js
@@ -804,17 +804,17 @@ calFilter.prototype = {
 
       // we've hit the maximum number of iterations without finding a match
       cal.WARN("[calFilter] getNextOccurrence: reached maximum iterations for " + aItem.title);
       return null;
     } else {
       // the parent item doesn't match the filter, we can return the first future exception
       // that matches the filter
       let exMatch = null;
-      aItem.recurrenceInfo.getExceptionIds({}).forEach(function(rID) {
+      aItem.recurrenceInfo.getExceptionIds().forEach(function(rID) {
         let ex = aItem.recurrenceInfo.getExceptionFor(rID);
         ex.QueryInterface(Ci.calIEvent);
         if (
           ex &&
           cal.dtz.now().compare(ex.startDate || ex.entryDate) < 0 &&
           this.isItemInFilters(ex)
         ) {
           exMatch = ex;
--- a/calendar/base/src/calItemBase.js
+++ b/calendar/base/src/calItemBase.js
@@ -964,17 +964,17 @@ calItemBase.prototype = {
       icalcomp.addProperty(attachment.icalProperty);
     }
 
     for (let relation of this.getRelations()) {
       icalcomp.addProperty(relation.icalProperty);
     }
 
     if (this.mRecurrenceInfo) {
-      for (let ritem of this.mRecurrenceInfo.getRecurrenceItems({})) {
+      for (let ritem of this.mRecurrenceInfo.getRecurrenceItems()) {
         icalcomp.addProperty(ritem.icalProperty);
       }
     }
 
     for (let cat of this.getCategories()) {
       let catprop = icssvc.createIcalProperty("CATEGORIES");
       catprop.value = cat;
       icalcomp.addProperty(catprop);
@@ -1046,17 +1046,17 @@ calItemBase.prototype = {
   clearAlarms: function() {
     this.modify();
     this.mAlarms = [];
   },
 
   // Array<calIItemBase> getOccurrencesBetween(in calIDateTime aStartDate, in calIDateTime aEndDate);
   getOccurrencesBetween: function(aStartDate, aEndDate) {
     if (this.recurrenceInfo) {
-      return this.recurrenceInfo.getOccurrences(aStartDate, aEndDate, 0, {});
+      return this.recurrenceInfo.getOccurrences(aStartDate, aEndDate, 0);
     }
 
     if (cal.item.checkIfInRange(this, aStartDate, aEndDate)) {
       return [this];
     }
 
     return [];
   },
--- a/calendar/base/src/calRecurrenceInfo.js
+++ b/calendar/base/src/calRecurrenceInfo.js
@@ -158,24 +158,23 @@ calRecurrenceInfo.prototype = {
       } else {
         this.mEndDate = MAX_PRTIME;
       }
     }
 
     return this.mEndDate;
   },
 
-  getRecurrenceItems: function(aCount) {
+  getRecurrenceItems: function() {
     this.ensureBaseItem();
 
-    aCount.value = this.mRecurrenceItems.length;
     return this.mRecurrenceItems;
   },
 
-  setRecurrenceItems: function(aCount, aItems) {
+  setRecurrenceItems: function(aItems) {
     this.ensureBaseItem();
     this.ensureMutable();
 
     // XXX should we clone these?
     this.mRecurrenceItems = aItems;
     this.mPositiveRules = null;
     this.mNegativeRules = null;
   },
@@ -583,40 +582,37 @@ calRecurrenceInfo.prototype = {
     // specified.
     if (aMaxCount && dates.length > aMaxCount) {
       dates = dates.slice(0, aMaxCount);
     }
 
     return dates;
   },
 
-  getOccurrenceDates: function(aRangeStart, aRangeEnd, aMaxCount, aCount) {
+  getOccurrenceDates: function(aRangeStart, aRangeEnd, aMaxCount) {
     let dates = this.calculateDates(aRangeStart, aRangeEnd, aMaxCount);
     dates = dates.map(date => date.rstart);
-    aCount.value = dates.length;
     return dates;
   },
 
-  getOccurrences: function(aRangeStart, aRangeEnd, aMaxCount, aCount) {
+  getOccurrences: function(aRangeStart, aRangeEnd, aMaxCount) {
     let results = [];
     let dates = this.calculateDates(aRangeStart, aRangeEnd, aMaxCount);
     if (dates.length) {
       let count;
       if (aMaxCount) {
         count = Math.min(aMaxCount, dates.length);
       } else {
         count = dates.length;
       }
 
       for (let i = 0; i < count; i++) {
         results.push(this.getOccurrenceFor(dates[i].id));
       }
     }
-
-    aCount.value = results.length;
     return results;
   },
 
   getOccurrenceFor: function(aRecurrenceId) {
     let proxy = this.getExceptionFor(aRecurrenceId);
     if (!proxy) {
       return this.item.createProxy(aRecurrenceId);
     }
@@ -727,26 +723,24 @@ calRecurrenceInfo.prototype = {
     return this.mExceptionMap[getRidKey(aRecurrenceId)] || null;
   },
 
   removeExceptionFor: function(aRecurrenceId) {
     this.ensureBaseItem();
     delete this.mExceptionMap[getRidKey(aRecurrenceId)];
   },
 
-  getExceptionIds: function(aCount) {
+  getExceptionIds: function() {
     this.ensureBaseItem();
 
     let ids = [];
     for (let ex in this.mExceptionMap) {
       let item = this.mExceptionMap[ex];
       ids.push(item.recurrenceId);
     }
-
-    aCount.value = ids.length;
     return ids;
   },
 
   // changing the startdate of an item needs to take exceptions into account.
   // in case we're about to modify a parentItem (aka 'folded' item), we need
   // to modify the recurrenceId's of all possibly existing exceptions as well.
   onStartDateChange: function(aNewStartTime, aOldStartTime) {
     // passing null for the new starttime would indicate an error condition,
@@ -762,17 +756,17 @@ calRecurrenceInfo.prototype = {
     let timeDiff = aNewStartTime
       .getInTimezone(cal.dtz.UTC)
       .subtractDate(aOldStartTime.getInTimezone(cal.dtz.UTC));
 
     let rdates = {};
 
     // take RDATE's and EXDATE's into account.
     const kCalIRecurrenceDate = Ci.calIRecurrenceDate;
-    let ritems = this.getRecurrenceItems({});
+    let ritems = this.getRecurrenceItems();
     for (let ritem of ritems) {
       let rDateInstance = cal.wrapInstance(ritem, kCalIRecurrenceDate);
       let rRuleInstance = cal.wrapInstance(ritem, Ci.calIRecurrenceRule);
       if (rDateInstance) {
         ritem = rDateInstance;
         let date = ritem.date;
         date.addDuration(timeDiff);
         if (!ritem.isNegative) {
@@ -788,17 +782,17 @@ calRecurrenceInfo.prototype = {
             ritem.untilDate = untilDate;
           }
         }
       }
     }
 
     let startTimezone = aNewStartTime.timezone;
     let modifiedExceptions = [];
-    for (let exid of this.getExceptionIds({})) {
+    for (let exid of this.getExceptionIds()) {
       let ex = this.getExceptionFor(exid);
       if (ex) {
         ex = ex.clone();
         // track RECURRENCE-IDs in DTSTART's or RDATE's timezone,
         // otherwise those won't match any longer w.r.t DST:
         let rid = ex.recurrenceId;
         let rdate = rdates[getRidKey(rid)];
         rid = rid.getInTimezone(rdate ? rdate.timezone : startTimezone);
--- a/calendar/lightning/content/lightning-item-iframe.js
+++ b/calendar/lightning/content/lightning-item-iframe.js
@@ -1424,17 +1424,17 @@ function getRepeatTypeAndUntilDate(aItem
       } else {
         gUntilDate = null;
       }
     }
   };
 
   if (recurrenceInfo) {
     repeatType = "custom";
-    let ritems = recurrenceInfo.getRecurrenceItems({});
+    let ritems = recurrenceInfo.getRecurrenceItems();
     let rules = [];
     let exceptions = [];
     for (let ritem of ritems) {
       if (ritem.isNegative) {
         exceptions.push(ritem);
       } else {
         rules.push(ritem);
       }
@@ -2899,17 +2899,17 @@ function updateRepeat(aSuppressDialogs, 
           } else {
             repeatDate = "forever";
           }
         } else {
           // Try to recover the last occurrence in 10(?) years.
           let endDate = gStartTime.clone();
           endDate.year += 10;
           let lastOccurrenceDate = null;
-          let dates = recurrenceInfo.getOccurrenceDates(gStartTime, endDate, 0, {});
+          let dates = recurrenceInfo.getOccurrenceDates(gStartTime, endDate, 0);
           if (dates) {
             lastOccurrenceDate = dates[dates.length - 1];
           }
           repeatDate = (lastOccurrenceDate || proposedUntilDate).getInTimezone(cal.dtz.floating);
           repeatDate = cal.dtz.dateTimeToJsDate(repeatDate);
         }
         setElementValue("repeat-until-datepicker", repeatDate);
       }
--- a/calendar/lightning/modules/ltnInvitationUtils.jsm
+++ b/calendar/lightning/modules/ltnInvitationUtils.jsm
@@ -144,17 +144,17 @@ ltn.invitation = {
       let formattedExDates = [];
       let modifiedOccurrences = [];
 
       let dateComptor = function(a, b) {
         return a.startDate.compare(b.startDate);
       };
 
       // Show removed instances
-      for (let exc of aEvent.recurrenceInfo.getRecurrenceItems({})) {
+      for (let exc of aEvent.recurrenceInfo.getRecurrenceItems()) {
         if (exc instanceof Ci.calIRecurrenceDate) {
           if (exc.isNegative) {
             // This is an EXDATE
             let excDate = exc.date.getInTimezone(kDefaultTimezone);
             formattedExDates.push(formatter.formatDateTime(excDate));
           } else {
             // This is an RDATE, close enough to a modified occurrence
             let excItem = aEvent.recurrenceInfo.getOccurrenceFor(exc.date);
@@ -162,17 +162,17 @@ ltn.invitation = {
           }
         }
       }
       if (formattedExDates.length > 0) {
         field("canceledOccurrences", formattedExDates.join("\n"));
       }
 
       // Show modified occurrences
-      for (let recurrenceId of aEvent.recurrenceInfo.getExceptionIds({})) {
+      for (let recurrenceId of aEvent.recurrenceInfo.getExceptionIds()) {
         let exc = aEvent.recurrenceInfo.getExceptionFor(recurrenceId);
         let excLocation = exc.getProperty("LOCATION");
 
         // Only show modified occurrence if start, duration or location
         // has changed.
         exc.QueryInterface(Ci.calIEvent);
         if (
           exc.startDate.compare(exc.recurrenceId) != 0 ||
--- a/calendar/providers/memory/calMemoryCalendar.js
+++ b/calendar/providers/memory/calMemoryCalendar.js
@@ -493,18 +493,17 @@ calMemoryCalendar.prototype = {
 
           let startDate = aRangeStart;
           if (!aRangeStart && cal.item.isToDo(item)) {
             startDate = item.entryDate;
           }
           let occurrences = item.recurrenceInfo.getOccurrences(
             startDate,
             aRangeEnd,
-            aCount ? aCount - itemsFound.length : 0,
-            {}
+            aCount ? aCount - itemsFound.length : 0
           );
           if (wantUnrespondedInvitations) {
             occurrences = occurrences.filter(checkUnrespondedInvitation);
           }
           if (!isEvent_) {
             occurrences = occurrences.filter(checkCompleted);
           }
           itemsFound = itemsFound.concat(occurrences);
--- a/calendar/providers/storage/calStorageCalendar.js
+++ b/calendar/providers/storage/calStorageCalendar.js
@@ -669,17 +669,17 @@ calStorageCalendar.prototype = {
         return 0;
       }
 
       let expandedItems = [];
       if (item.recurrenceInfo && asOccurrences) {
         // If the item is recurring, get all occurrences that fall in
         // the range. If the item doesn't fall into the range at all,
         // this expands to 0 items.
-        expandedItems = item.recurrenceInfo.getOccurrences(aRangeStart, aRangeEnd, 0, {});
+        expandedItems = item.recurrenceInfo.getOccurrences(aRangeStart, aRangeEnd, 0);
         if (wantUnrespondedInvitations) {
           expandedItems = expandedItems.filter(checkUnrespondedInvitation);
         }
       } else if (
         (!wantUnrespondedInvitations || checkUnrespondedInvitation(item)) &&
         cal.item.checkIfInRange(item, aRangeStart, aRangeEnd)
       ) {
         // If no occurrences are wanted, check only the parent item.
@@ -2345,26 +2345,26 @@ calStorageCalendar.prototype = {
   },
 
   prepareRecurrence: function(stmts, item, olditem) {
     let flags = 0;
 
     let rec = item.recurrenceInfo;
     if (rec) {
       flags = CAL_ITEM_FLAG.HAS_RECURRENCE;
-      let ritems = rec.getRecurrenceItems({});
+      let ritems = rec.getRecurrenceItems();
       let array = this.prepareAsyncStatement(stmts, this.mInsertRecurrence);
       for (let ritem of ritems) {
         let params = this.prepareAsyncParams(array);
         params.bindByName("item_id", item.id);
         params.bindByName("icalString", ritem.icalString);
         array.addParams(params);
       }
 
-      let exceptions = rec.getExceptionIds({});
+      let exceptions = rec.getExceptionIds();
       if (exceptions.length > 0) {
         flags |= CAL_ITEM_FLAG.HAS_EXCEPTIONS;
 
         // we need to serialize each exid as a separate
         // event/todo; setupItemBase will handle
         // writing the recurrenceId for us
         for (let exid of exceptions) {
           let ex = rec.getExceptionFor(exid);
@@ -2586,17 +2586,17 @@ calStorageCalendar.prototype = {
   _propagateSequence: function(aItem, newSequence) {
     if (newSequence) {
       aItem.setProperty("SEQUENCE", newSequence);
     } else {
       aItem.deleteProperty("SEQUENCE");
     }
     let rec = aItem.recurrenceInfo;
     if (rec) {
-      let exceptions = rec.getExceptionIds({});
+      let exceptions = rec.getExceptionIds();
       if (exceptions.length > 0) {
         for (let exid of exceptions) {
           let ex = rec.getExceptionFor(exid);
           if (newSequence) {
             ex.setProperty("SEQUENCE", newSequence);
           } else {
             ex.deleteProperty("SEQUENCE");
           }
--- a/calendar/test/unit/test_bug343792.js
+++ b/calendar/test/unit/test_bug343792.js
@@ -52,15 +52,15 @@ function really_run_test() {
     "END:VEVENT\n" +
     "END:VCALENDAR";
 
   let event = createEventFromIcalString(icalString);
   let start = createDate(2009, 4, 1);
   let end = createDate(2009, 4, 30);
 
   // the following call caused a never ending loop:
-  let occurrenceDates = event.recurrenceInfo.getOccurrenceDates(start, end, 0, {});
+  let occurrenceDates = event.recurrenceInfo.getOccurrenceDates(start, end, 0);
   equal(occurrenceDates.length, 4);
 
   // the following call caused a never ending loop:
-  let occurrences = event.recurrenceInfo.getOccurrences(start, end, 0, {});
+  let occurrences = event.recurrenceInfo.getOccurrences(start, end, 0);
   equal(occurrences.length, 4);
 }
--- a/calendar/test/unit/test_bug356207.js
+++ b/calendar/test/unit/test_bug356207.js
@@ -33,15 +33,15 @@ function really_run_test() {
     "END:VEVENT\n" +
     "END:VCALENDAR";
 
   let event = createEventFromIcalString(icalString);
   let start = createDate(2009, 0, 1);
   let end = createDate(2009, 11, 31);
 
   // the following call caused a never ending loop:
-  let occurrenceDates = event.recurrenceInfo.getOccurrenceDates(start, end, 0, {});
+  let occurrenceDates = event.recurrenceInfo.getOccurrenceDates(start, end, 0);
   equal(occurrenceDates.length, 2);
 
   // the following call caused a never ending loop:
-  let occurrences = event.recurrenceInfo.getOccurrences(start, end, 0, {});
+  let occurrences = event.recurrenceInfo.getOccurrences(start, end, 0);
   equal(occurrences.length, 2);
 }
--- a/calendar/test/unit/test_ics_parser.js
+++ b/calendar/test/unit/test_ics_parser.js
@@ -87,17 +87,17 @@ function test_fake_parent() {
   equal(item.id, "123");
   ok(!!item.recurrenceInfo);
   equal(item.startDate.icalString, "20120101T010101");
   equal(item.getProperty("X-MOZ-FAKED-MASTER"), "1");
 
   let rinfo = item.recurrenceInfo;
 
   equal(rinfo.countRecurrenceItems(), 1);
-  let excs = rinfo.getOccurrences(cal.createDateTime("20120101T010101"), null, 0, {});
+  let excs = rinfo.getOccurrences(cal.createDateTime("20120101T010101"), null, 0);
   equal(excs.length, 1);
   let exc = excs[0].QueryInterface(Ci.calIEvent);
   equal(exc.startDate.icalString, "20120101T010102");
 
   equal(parser.getParentlessItems()[0], exc);
 }
 
 function test_async() {
--- a/calendar/test/unit/test_recur.js
+++ b/calendar/test/unit/test_recur.js
@@ -27,18 +27,18 @@ function test_rules() {
     dump("Checking '" + event.getProperty("DESCRIPTION") + "'\n");
 
     // Immutability is required for testing the recurrenceEndDate property.
     event.makeImmutable();
 
     // Get recurrence dates
     let start = createDate(1990, 0, 1);
     let end = createDate(2020, 0, 1);
-    let recdates = event.recurrenceInfo.getOccurrenceDates(start, end, 0, {});
-    let occurrences = event.recurrenceInfo.getOccurrences(start, end, 0, {});
+    let recdates = event.recurrenceInfo.getOccurrenceDates(start, end, 0);
+    let occurrences = event.recurrenceInfo.getOccurrences(start, end, 0);
 
     // Check number of items
     dump("Expected " + expected.length + " occurrences\n");
     dump("Got: " + recdates.map(x => x.toString()) + "\n");
     equal(recdates.length, expected.length);
     let fmt = cal.getDateFormatter();
 
     for (let i = 0; i < expected.length; i++) {
@@ -785,39 +785,39 @@ function test_limit() {
       "UID:1\n" +
       "DTSTART:20020401T114500\n" +
       "DTEND:20020401T124500\n"
   );
   dump("ics: " + item.icalString + "\n");
 
   let start = createDate(1990, 0, 1);
   let end = createDate(2020, 0, 1);
-  let recdates = item.recurrenceInfo.getOccurrenceDates(start, end, 0, {});
-  let occurrences = item.recurrenceInfo.getOccurrences(start, end, 0, {});
+  let recdates = item.recurrenceInfo.getOccurrenceDates(start, end, 0);
+  let occurrences = item.recurrenceInfo.getOccurrences(start, end, 0);
 
   equal(recdates.length, 3);
   equal(occurrences.length, 3);
 
-  recdates = item.recurrenceInfo.getOccurrenceDates(start, end, 2, {});
-  occurrences = item.recurrenceInfo.getOccurrences(start, end, 2, {});
+  recdates = item.recurrenceInfo.getOccurrenceDates(start, end, 2);
+  occurrences = item.recurrenceInfo.getOccurrences(start, end, 2);
 
   equal(recdates.length, 2);
   equal(occurrences.length, 2);
 
-  recdates = item.recurrenceInfo.getOccurrenceDates(start, end, 9, {});
-  occurrences = item.recurrenceInfo.getOccurrences(start, end, 9, {});
+  recdates = item.recurrenceInfo.getOccurrenceDates(start, end, 9);
+  occurrences = item.recurrenceInfo.getOccurrences(start, end, 9);
 
   equal(recdates.length, 3);
   equal(occurrences.length, 3);
 }
 
 function test_clone(event) {
-  let oldRecurItems = event.recurrenceInfo.getRecurrenceItems({});
+  let oldRecurItems = event.recurrenceInfo.getRecurrenceItems();
   let cloned = event.recurrenceInfo.clone();
-  let newRecurItems = cloned.getRecurrenceItems({});
+  let newRecurItems = cloned.getRecurrenceItems();
 
   // Check number of recurrence items
   equal(oldRecurItems.length, newRecurItems.length);
 
   for (let i = 0; i < oldRecurItems.length; i++) {
     // Check if recurrence item cloned correctly
     equal(oldRecurItems[i].icalProperty.icalString, newRecurItems[i].icalProperty.icalString);
   }
@@ -831,17 +831,17 @@ function test_interface() {
       "EXDATE:20020403T114500Z\r\n" +
       "RDATE:20020401T114500Z\r\n"
   );
 
   let rinfo = item.recurrenceInfo;
   ok(cal.data.compareObjects(rinfo.item, item, Ci.calIEvent));
 
   // getRecurrenceItems
-  let ritems = rinfo.getRecurrenceItems({});
+  let ritems = rinfo.getRecurrenceItems();
   equal(ritems.length, 3);
 
   let checkritems = new Map(
     ritems.map(ritem => [ritem.icalProperty.propertyName, ritem.icalProperty])
   );
   let rparts = new Map(
     checkritems
       .get("RRULE")
@@ -859,17 +859,17 @@ function test_interface() {
   let newRItems = [cal.createRecurrenceRule(), cal.createRecurrenceDate()];
 
   newRItems[0].type = "DAILY";
   newRItems[0].interval = 1;
   newRItems[0].count = 1;
   newRItems[1].isNegative = true;
   newRItems[1].date = cal.createDateTime("20020404T114500Z");
 
-  rinfo.setRecurrenceItems(2, newRItems);
+  rinfo.setRecurrenceItems(newRItems);
   let itemString = item.icalString;
 
   equal(itemString.match(/RRULE:[A-Z=,]*FREQ=WEEKLY/), null);
   equal(itemString.match(/EXDATE[A-Z;=-]*:20020403T114500Z/, null));
   equal(itemString.match(/RDATE[A-Z;=-]*:20020401T114500Z/, null));
   notEqual(itemString.match(/RRULE:[A-Z=,]*FREQ=DAILY/), null);
   notEqual(itemString.match(/EXDATE[A-Z;=-]*:20020404T114500Z/, null));
 
@@ -944,25 +944,25 @@ function test_interface() {
 
   // modifyException immutable
   let occ2 = rinfo.getOccurrenceFor(occDate2);
   occ2.makeImmutable();
   rinfo.modifyException(occ2, true);
   ok(rinfo.getExceptionFor(occDate2) != null);
 
   // getExceptionIds
-  let ids = rinfo.getExceptionIds({});
+  let ids = rinfo.getExceptionIds();
   equal(ids.length, 2);
   ok(ids[0].compare(occDate1) == 0);
   ok(ids[1].compare(occDate2) == 0);
 
   // removeExceptionFor
   rinfo.removeExceptionFor(occDate1);
   ok(rinfo.getExceptionFor(occDate1) == null);
-  equal(rinfo.getExceptionIds({}).length, 1);
+  equal(rinfo.getExceptionIds().length, 1);
 }
 
 function test_rrule_interface() {
   let item = makeEvent(
     "DTSTART:20020402T114500Z\r\n" +
       "DTEND:20020402T124500Z\r\n" +
       "RRULE:INTERVAL=2;FREQ=WEEKLY;COUNT=6;BYDAY=TU,WE\r\n"
   );
@@ -1136,18 +1136,17 @@ function test_failures() {
       "END:VTODO\r\n" +
       "END:VCALENDAR\r\n"
   );
   rinfo = item.recurrenceInfo;
   equal(
     rinfo.getOccurrenceDates(
       cal.createDateTime("20120101T010101"),
       cal.createDateTime("20120203T010101"),
-      0,
-      {}
+      0
     ).length,
     0
   );
 }
 
 function test_immutable() {
   let item = createTodoFromIcalString(
     "BEGIN:VCALENDAR\r\n" +
--- a/calendar/test/unit/test_storage.js
+++ b/calendar/test/unit/test_storage.js
@@ -70,17 +70,17 @@ add_task(async () => {
         let relations = item.getRelations();
         let rel = relations[0];
         equal(relations.length, 1);
         equal(rel.relType, "SIBLING");
         equal(rel.relId, "VALUE");
         equal(rel.getParameter("FOO"), "BAR");
 
         // Check recurrence item
-        for (let ritem of item.recurrenceInfo.getRecurrenceItems({})) {
+        for (let ritem of item.recurrenceInfo.getRecurrenceItems()) {
           if (ritem instanceof Ci.calIRecurrenceRule) {
             equal(ritem.type, "MONTHLY");
             equal(ritem.interval, 2);
             equal(ritem.count, 5);
             equal(ritem.isByCount, true);
             equal(ritem.getComponent("BYDAY").toString(), [2].toString());
             equal(ritem.isNegative, false);
           } else if (ritem instanceof Ci.calIRecurrenceDate) {