Bug 1440982 - Move calIteratorUtils to cal.iterate namespace - automatic changes. r=MakeMyDay
authorPhilipp Kewisch <mozilla@kewis.ch>
Sat, 24 Feb 2018 22:16:16 +0100
changeset 30561 f0dc8dca11f86cbbf51b5bb4d48ca701700d6a54
parent 30560 0ef2b2e4c3dd047bead19f141c8709d44c501bda
child 30562 52d3403860a3b8c923f13189f64a02662aba5d28
push id2172
push usermozilla@kewis.ch
push dateSun, 15 Apr 2018 05:33:14 +0000
treeherdercomm-beta@33a67b0129b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMakeMyDay
bugs1440982
Bug 1440982 - Move calIteratorUtils to cal.iterate namespace - automatic changes. r=MakeMyDay MozReview-Commit-ID: EMyQ3d4Xr72
calendar/base/modules/calItemUtils.jsm
calendar/base/modules/calIteratorUtils.jsm
calendar/base/modules/calItipUtils.jsm
calendar/base/src/calAlarm.js
calendar/base/src/calAlarmService.js
calendar/base/src/calAttachment.js
calendar/base/src/calAttendee.js
calendar/base/src/calCachedCalendar.js
calendar/base/src/calIcsParser.js
calendar/base/src/calIcsSerializer.js
calendar/base/src/calItemBase.js
calendar/base/src/calItipItem.js
calendar/base/src/calRelation.js
calendar/base/src/calTimezoneService.js
calendar/lightning/content/lightning.js
calendar/providers/caldav/calDavCalendar.js
calendar/providers/memory/calMemoryCalendar.js
calendar/providers/wcap/calWcapCalendarItems.js
calendar/providers/wcap/calWcapSession.js
--- a/calendar/base/modules/calItemUtils.jsm
+++ b/calendar/base/modules/calItemUtils.jsm
@@ -433,25 +433,25 @@ var calitem = {
             }
             return hash;
         }
 
         // This doesn't have to be super correct rfc5545, it just needs to be
         // in the same order
         function normalizeComponent(comp) {
             let props = [];
-            for (let prop of cal.ical.propertyIterator(comp)) {
+            for (let prop of cal.iterate.icalProperty(comp)) {
                 if (!(prop.propertyName in ignoreProps)) {
                     props.push(normalizeProperty(prop));
                 }
             }
             props = props.sort();
 
             let comps = [];
-            for (let subcomp of cal.ical.subcomponentIterator(comp)) {
+            for (let subcomp of cal.iterate.icalSubcomponent(comp)) {
                 comps.push(normalizeComponent(subcomp));
             }
             comps = comps.sort();
 
             return comp.componentType + props.join("\r\n") + comps.join("\r\n");
         }
 
         function normalizeProperty(prop) {
--- a/calendar/base/modules/calIteratorUtils.jsm
+++ b/calendar/base/modules/calIteratorUtils.jsm
@@ -66,17 +66,17 @@ var caliterate = {
                 run: function() {
                     let startTime = (new Date()).getTime();
                     while (((new Date()).getTime() - startTime) < LATENCY) {
                         let next = ourIter.next();
                         let done = next.done;
 
                         if (!done) {
                             let rc = body(next.value);
-                            if (rc == cal.forEach.BREAK) {
+                            if (rc == cal.iterate.forEach.BREAK) {
                                 done = true;
                             }
                         }
 
                         if (done) {
                             if (completed) {
                                 completed();
                             }
@@ -100,40 +100,40 @@ var caliterate = {
      *  Yields all subcomponents in all calendars in the passed component.
      *  - If the passed component is an XROOT (contains multiple calendars), then go through all
      *    VCALENDARs in it and get their subcomponents.
      *  - If the passed component is a VCALENDAR, iterate through its direct subcomponents.
      *  - Otherwise assume the passed component is the item itself and yield only the passed
      *    component.
      *
      * This iterator can only be used in a for..of block:
-     *   for (let component of cal.ical.calendarComponentIterator(aComp)) { ... }
+     *   for (let component of cal.iterate.icalComponent(aComp)) { ... }
      *
      *  @param {calIIcalComponent} aComponent   The component to iterate given the above rules.
      *  @param {String} aCompType               The type of item to iterate.
      *  @yields {calIIcalComponent}             The iterator that yields all items.
      */
     icalComponent: function* (aComponent, aCompType="ANY") {
         if (aComponent && aComponent.componentType == "VCALENDAR") {
-            yield* cal.ical.subcomponentIterator(aComponent, aCompType);
+            yield* cal.iterate.icalSubcomponent(aComponent, aCompType);
         } else if (aComponent && aComponent.componentType == "XROOT") {
-            for (let calComp of cal.ical.subcomponentIterator(aComponent, "VCALENDAR")) {
-                yield* cal.ical.subcomponentIterator(calComp, aCompType);
+            for (let calComp of cal.iterate.icalSubcomponent(aComponent, "VCALENDAR")) {
+                yield* cal.iterate.icalSubcomponent(calComp, aCompType);
             }
         } else if (aComponent && (aCompType == "ANY" || aCompType == aComponent.componentType)) {
             yield aComponent;
         }
     },
 
     /**
      * Use to iterate through all subcomponents of a calIIcalComponent. This iterators depth is 1,
      * this means no sub-sub-components will be iterated.
      *
      * This iterator can only be used in a for() block:
-     *   for (let component of cal.ical.subcomponentIterator(aComp)) { ... }
+     *   for (let component of cal.iterate.icalSubcomponent(aComp)) { ... }
      *
      * @param {calIIcalComponent} aComponent    The component who's subcomponents to iterate.
      * @param {?String} aSubcomp                (optional) the specific subcomponent to enumerate.
      *                                            If not given, "ANY" will be used.
      * @yields {calIIcalComponent}              An iterator object to iterate the properties.
      */
     icalSubcomponent: function* (aComponent, aSubcomp="ANY") {
         for (let subcomp = aComponent.getFirstSubcomponent(aSubcomp);
@@ -141,17 +141,17 @@ var caliterate = {
              subcomp = aComponent.getNextSubcomponent(aSubcomp)) {
             yield subcomp;
         }
     },
 
     /**
      * Use to iterate through all properties of a calIIcalComponent.
      * This iterator can only be used in a for() block:
-     *   for (let property of cal.ical.propertyIterator(aComp)) { ... }
+     *   for (let property of cal.iterate.icalProperty(aComp)) { ... }
      *
      * @param {calIIcalComponent} aComponent    The component to iterate.
      * @param {?String} aProperty               (optional) the specific property to enumerate.
      *                                            If not given, "ANY" will be used.
      * @yields {calIIcalProperty}               An iterator object to iterate the properties.
      */
     icalProperty: function* (aComponent, aProperty="ANY") {
         for (let prop = aComponent.getFirstProperty(aProperty);
@@ -159,19 +159,19 @@ var caliterate = {
              prop = aComponent.getNextProperty(aProperty)) {
             yield prop;
         }
     },
 
     /**
      * Use to iterate through all parameters of a calIIcalProperty.
      * This iterator behaves similar to the object iterator. Possible uses:
-     *   for (let paramName in cal.ical.paramIterator(prop)) { ... }
+     *   for (let paramName in cal.iterate.icalParameter(prop)) { ... }
      * or:
-     *   for (let [paramName, paramValue] of cal.ical.paramIterator(prop)) { ... }
+     *   for (let [paramName, paramValue] of cal.iterate.icalParameter(prop)) { ... }
      *
      * @param {calIIcalProperty} aProperty         The property to iterate.
      * @yields {[String, String]}                  An iterator object to iterate the properties.
      */
     icalParameter: function* (aProperty) {
         let paramSet = new Set();
         for (let paramName = aProperty.getFirstParameterName();
              paramName;
--- a/calendar/base/modules/calItipUtils.jsm
+++ b/calendar/base/modules/calItipUtils.jsm
@@ -971,18 +971,18 @@ var calitip = {
                 RDATE: true,
                 RRULE: true,
                 EXDATE: true,
                 STATUS: true,
                 LOCATION: true
             };
 
             let propStrings = [];
-            for (let item of cal.itemIterator([aItem])) {
-                for (let prop of cal.ical.propertyIterator(item.icalComponent)) {
+            for (let item of cal.iterate.items([aItem])) {
+                for (let prop of cal.iterate.icalProperty(item.icalComponent)) {
                     if (prop.propertyName in majorProps) {
                         propStrings.push(item.recurrenceId + "#" + prop.icalString);
                     }
                 }
             }
             propStrings.sort();
             return propStrings.join("");
         };
--- a/calendar/base/src/calAlarm.js
+++ b/calendar/base/src/calAlarm.js
@@ -533,25 +533,25 @@ calAlarm.prototype = {
             throw Components.results.NS_ERROR_INVALID_ARG;
         } else {
             this.repeatOffset = null;
             this.repeat = 0;
         }
 
         // Set up attendees
         this.clearAttendees();
-        for (let attendeeProp of cal.ical.propertyIterator(aComp, "ATTENDEE")) {
+        for (let attendeeProp of cal.iterate.icalProperty(aComp, "ATTENDEE")) {
             let attendee = cal.createAttendee();
             attendee.icalProperty = attendeeProp;
             this.addAttendee(attendee);
         }
 
         // Set up attachments
         this.clearAttachments();
-        for (let attachProp of cal.ical.propertyIterator(aComp, "ATTACH")) {
+        for (let attachProp of cal.iterate.icalProperty(aComp, "ATTACH")) {
             let attach = cal.createAttachment();
             attach.icalProperty = attachProp;
             this.addAttachment(attach);
         }
 
         // Set up summary
         this.summary = (summaryProp ? summaryProp.value : null);
 
@@ -562,21 +562,21 @@ calAlarm.prototype = {
         // the default for an X-Prop is TEXT and in older versions we didn't set
         // VALUE=DATE-TIME.
         this.lastAck = (lastAckProp ? cal.createDateTime(lastAckProp.valueAsIcalString) : null);
 
         this.mProperties = new cal.data.PropertyMap();
         this.mPropertyParams = {};
 
         // Other properties
-        for (let prop of cal.ical.propertyIterator(aComp)) {
+        for (let prop of cal.iterate.icalProperty(aComp)) {
             if (!this.promotedProps[prop.propertyName]) {
                 this.setProperty(prop.propertyName, prop.value);
 
-                for (let [paramName, param] of cal.ical.paramIterator(prop)) {
+                for (let [paramName, param] of cal.iterate.icalParameter(prop)) {
                     if (!(prop.propertyName in this.mPropertyParams)) {
                         this.mPropertyParams[prop.propertyName] = {};
                     }
                     this.mPropertyParams[prop.propertyName][paramName] = param;
                 }
             }
         }
         return aComp;
--- a/calendar/base/src/calAlarmService.js
+++ b/calendar/base/src/calAlarmService.js
@@ -519,17 +519,17 @@ calAlarmService.prototype = {
                     this.addRemovePromise.resolve();
                 }
             },
             onGetResult: function(aCalendar, aStatus, aItemType, aDetail, aCount, aItems) {
                 let promise = this.addRemovePromise;
                 this.batchCount++;
                 this.results = true;
 
-                cal.forEach(aItems, (item) => {
+                cal.iterate.forEach(aItems, (item) => {
                     try {
                         this.alarmService.removeAlarmsForItem(item);
                         this.alarmService.addAlarmsForItem(item);
                     } catch (ex) {
                         promise.reject(ex);
                     }
                 }, () => {
                     if (--this.batchCount <= 0) {
--- a/calendar/base/src/calAttachment.js
+++ b/calendar/base/src/calAttachment.js
@@ -122,17 +122,17 @@ calAttachment.prototype = {
     },
 
     set icalProperty(attProp) {
         // Reset the property bag for the parameters, it will be re-initialized
         // from the ical property.
         this.mProperties = new cal.data.PropertyMap();
         this.setData(attProp.value);
 
-        for (let [name, value] of cal.ical.paramIterator(attProp)) {
+        for (let [name, value] of cal.iterate.icalParameter(attProp)) {
             this.setParameter(name, value);
         }
     },
 
     get icalString() {
         let comp = this.icalProperty;
         return (comp ? comp.icalString : "");
     },
--- a/calendar/base/src/calAttendee.js
+++ b/calendar/base/src/calAttendee.js
@@ -83,17 +83,17 @@ calAttendee.prototype = {
             // Don't copy these to the property bag.
             promotedProps[prop.ics] = true;
         }
 
         // Reset the property bag for the parameters, it will be re-initialized
         // from the ical property.
         this.mProperties = new cal.data.PropertyMap();
 
-        for (let [name, value] of cal.ical.paramIterator(icalatt)) {
+        for (let [name, value] of cal.iterate.icalParameter(icalatt)) {
             if (!promotedProps[name]) {
                 this.setProperty(name, value);
             }
         }
     },
 
     get icalProperty() {
         let icssvc = cal.getIcsService();
--- a/calendar/base/src/calCachedCalendar.js
+++ b/calendar/base/src/calCachedCalendar.js
@@ -356,17 +356,17 @@ calCachedCalendar.prototype = {
                         // TODO instead of deleting the calendar and creating a new
                         // one, maybe we want to do a "real" sync between the
                         // existing local calendar and the remote calendar.
                         self.setupCachedCalendar();
                         this.hasRenewedCalendar = true;
                     }
 
                     this.getsReceived++;
-                    cal.forEach(aItems, (item) => {
+                    cal.iterate.forEach(aItems, (item) => {
                         // Adding items recd from the Memory Calendar
                         // These may be different than what the cache has
                         completeListener.modifiedTimes[item.id] = item.lastModifiedTime;
                         self.mCachedCalendar.addItem(item, null);
                     }, () => {
                         completeListener.getsCompleted++;
                         if (completeListener.opCompleted) {
                             // onOperationComplete was called, but we were not ready yet. call it now.
@@ -381,17 +381,17 @@ calCachedCalendar.prototype = {
                 if (this.getsCompleted < this.getsReceived) {
                     // If not all of our gets have been processed, then save the
                     // arguments and finish processing later.
                     this.opCompleted = Array.from(arguments);
                     return;
                 }
 
                 if (Components.isSuccessCode(aStatus)) {
-                    cal.forEach(self.offlineCachedItems, (item) => {
+                    cal.iterate.forEach(self.offlineCachedItems, (item) => {
                         switch (self.offlineCachedItemFlags[item.hashId]) {
                             case cICL.OFFLINE_FLAG_CREATED_RECORD:
                                 // Created items are not present on the server, so its safe to adopt them
                                 self.adoptOfflineItem(item.clone(), null);
                                 break;
                             case cICL.OFFLINE_FLAG_MODIFIED_RECORD:
                                 // Two Cases Here:
                                 if (item.id in completeListener.modifiedTimes) {
--- a/calendar/base/src/calIcsParser.js
+++ b/calendar/base/src/calIcsParser.js
@@ -51,23 +51,23 @@ calIcsParser.prototype = {
             }
         }
 
         let self = this;
         let state = new parserState(this, aAsyncParsing);
 
         while (calComp) {
             // Get unknown properties from the VCALENDAR
-            for (let prop of cal.ical.propertyIterator(calComp)) {
+            for (let prop of cal.iterate.icalProperty(calComp)) {
                 if (prop.propertyName != "VERSION" && prop.propertyName != "PRODID") {
                     this.mProperties.push(prop);
                 }
             }
 
-            for (let subComp of cal.ical.subcomponentIterator(calComp)) {
+            for (let subComp of cal.iterate.icalSubcomponent(calComp)) {
                 state.submit(subComp);
             }
             calComp = rootComp.getNextSubcomponent("VCALENDAR");
         }
 
         state.join(() => {
             let fakedParents = {};
             // tag "exceptions", i.e. items with rid:
--- a/calendar/base/src/calIcsSerializer.js
+++ b/calendar/base/src/calIcsSerializer.js
@@ -68,15 +68,15 @@ calIcsSerializer.prototype = {
 
         for (let prop of this.mProperties) {
             calComp.addProperty(prop);
         }
         for (let comp of this.mComponents) {
             calComp.addSubcomponent(comp);
         }
 
-        for (let item of cal.itemIterator(this.mItems)) {
+        for (let item of cal.iterate.items(this.mItems)) {
             calComp.addSubcomponent(item.icalComponent);
         }
 
         return calComp;
     }
 };
--- a/calendar/base/src/calItemBase.js
+++ b/calendar/base/src/calItemBase.js
@@ -795,54 +795,54 @@ calItemBase.prototype = {
         // re-initializing from scratch -- no light proxy anymore:
         this.mIsProxy = false;
         this.mProperties = new cal.data.PropertyMap();
         this.mPropertyParams = {};
 
         this.mapPropsFromICS(icalcomp, this.icsBasePropMap);
 
         this.mAttendees = []; // don't inherit anything from parent
-        for (let attprop of cal.ical.propertyIterator(icalcomp, "ATTENDEE")) {
+        for (let attprop of cal.iterate.icalProperty(icalcomp, "ATTENDEE")) {
             let att = new calAttendee();
             att.icalProperty = attprop;
             this.addAttendee(att);
         }
 
         this.mAttachments = []; // don't inherit anything from parent
-        for (let attprop of cal.ical.propertyIterator(icalcomp, "ATTACH")) {
+        for (let attprop of cal.iterate.icalProperty(icalcomp, "ATTACH")) {
             let att = new calAttachment();
             att.icalProperty = attprop;
             this.addAttachment(att);
         }
 
         this.mRelations = []; // don't inherit anything from parent
-        for (let relprop of cal.ical.propertyIterator(icalcomp, "RELATED-TO")) {
+        for (let relprop of cal.iterate.icalProperty(icalcomp, "RELATED-TO")) {
             let rel = new calRelation();
             rel.icalProperty = relprop;
             this.addRelation(rel);
         }
 
         let org = null;
         let orgprop = icalcomp.getFirstProperty("ORGANIZER");
         if (orgprop) {
             org = new calAttendee();
             org.icalProperty = orgprop;
             org.isOrganizer = true;
         }
         this.mOrganizer = org;
 
         this.mCategories = [];
-        for (let catprop of cal.ical.propertyIterator(icalcomp, "CATEGORIES")) {
+        for (let catprop of cal.iterate.icalProperty(icalcomp, "CATEGORIES")) {
             this.mCategories.push(catprop.value);
         }
 
         // find recurrence properties
         let rec = null;
         if (!this.recurrenceId) {
-            for (let recprop of cal.ical.propertyIterator(icalcomp)) {
+            for (let recprop of cal.iterate.icalProperty(icalcomp)) {
                 let ritem = null;
                 switch (recprop.propertyName) {
                     case "RRULE":
                     case "EXRULE":
                         ritem = cal.createRecurrenceRule();
                         break;
                     case "RDATE":
                     case "EXDATE":
@@ -857,17 +857,17 @@ calItemBase.prototype = {
                     rec = cal.createRecurrenceInfo(this);
                 }
                 rec.appendRecurrenceItem(ritem);
             }
         }
         this.mRecurrenceInfo = rec;
 
         this.mAlarms = []; // don't inherit anything from parent
-        for (let alarmComp of cal.ical.subcomponentIterator(icalcomp, "VALARM")) {
+        for (let alarmComp of cal.iterate.icalSubcomponent(icalcomp, "VALARM")) {
             let alarm = cal.createAlarm();
             try {
                 alarm.icalComponent = alarmComp;
                 this.addAlarm(alarm, true);
             } catch (e) {
                 cal.ERROR("Invalid alarm for item: " +
                           this.id + " (" +
                           alarmComp.serializeToICS() + ")" +
@@ -887,21 +887,21 @@ calItemBase.prototype = {
     /**
      * Import all properties not in the promoted map into this item's extended
      * properties bag.
      *
      * @param icalcomp      The ical component to read.
      * @param promoted      The map of promoted properties.
      */
     importUnpromotedProperties: function(icalcomp, promoted) {
-        for (let prop of cal.ical.propertyIterator(icalcomp)) {
+        for (let prop of cal.iterate.icalProperty(icalcomp)) {
             let propName = prop.propertyName;
             if (!promoted[propName]) {
                 this.setProperty(propName, prop.value);
-                for (let [paramName, paramValue] of cal.ical.paramIterator(prop)) {
+                for (let [paramName, paramValue] of cal.iterate.icalParameter(prop)) {
                     if (!(propName in this.mPropertyParams)) {
                         this.mPropertyParams[propName] = {};
                     }
                     this.mPropertyParams[propName][paramName] = paramValue;
                 }
             }
         }
     },
--- a/calendar/base/src/calItipItem.js
+++ b/calendar/base/src/calItipItem.js
@@ -142,17 +142,17 @@ calItipItem.prototype = {
                 removeSchedulingParams(item.organizer);
             }
 
             item.setProperty("DTSTAMP", stamp);
             item.setProperty("LAST-MODIFIED", lastModified); // need to be last to undirty the item
         }
 
         this.mItemList = [];
-        for (let item of cal.itemIterator(parser.getItems({}))) {
+        for (let item of cal.iterate.items(parser.getItems({}))) {
             cleanItem(item);
             // only push non-faked master items or
             // the overridden instances of faked master items
             // to the list:
             if (item == item.parentItem) {
                 if (!item.hasProperty("X-MOZ-FAKED-MASTER")) {
                     this.mItemList.push(item);
                 }
--- a/calendar/base/src/calRelation.js
+++ b/calendar/base/src/calRelation.js
@@ -79,17 +79,17 @@ calRelation.prototype = {
     set icalProperty(attProp) {
         // Reset the property bag for the parameters, it will be re-initialized
         // from the ical property.
         this.mProperties = new cal.data.PropertyMap();
 
         if (attProp.value) {
             this.mId = attProp.value;
         }
-        for (let [name, value] of cal.ical.paramIterator(attProp)) {
+        for (let [name, value] of cal.iterate.icalParameter(attProp)) {
             if (name == "RELTYPE") {
                 this.mType = value;
                 continue;
             }
 
             this.setParameter(name, value);
         }
     },
--- a/calendar/base/src/calTimezoneService.js
+++ b/calendar/base/src/calTimezoneService.js
@@ -454,17 +454,17 @@ function guessSystemTimezone() {
     function findCurrentTimePeriod(timezone, subComp, standardOrDaylight,
                                    isForNextTransitionDate) {
         // Iterate through 'STANDARD' declarations or 'DAYLIGHT' declarations
         // (periods in history with different settings.
         //  e.g., US changes daylight start in 2007 (from April to March).)
         // Each period is marked by a DTSTART.
         // Find the currently applicable period: has most recent DTSTART
         // not later than today and no UNTIL, or UNTIL is greater than today.
-        for (let period of cal.ical.subcomponentIterator(subComp, standardOrDaylight)) {
+        for (let period of cal.iterate.icalSubcomponent(subComp, standardOrDaylight)) {
             periodStartCalDate.icalString = getIcalString(period, "DTSTART");
             periodStartCalDate.timezone = timezone;
             if (oneYrUTC.nativeTime < periodStartCalDate.nativeTime) {
                 continue; // period starts too far in future
             }
             // Must examine UNTIL date (not next daylight start) because
             // some zones (e.g., Arizona, Hawaii) may stop using daylight
             // time, so there might not be a next daylight start.
--- a/calendar/lightning/content/lightning.js
+++ b/calendar/lightning/content/lightning.js
@@ -125,17 +125,17 @@ pref("calendar.categories.names", "");
 
 // Make sure mouse wheel shift and no key actions to scroll lines.
 pref("mousewheel.withnokey.action", 0);
 pref("mousewheel.withshiftkey.action", 0);
 
 // Disable use of worker threads. Restart needed.
 pref("calendar.threading.disabled", false);
 
-// The maximum time in microseconds that a cal.forEach event can take (soft limit).
+// The maximum time in microseconds that a cal.iterate.forEach event can take (soft limit).
 pref("calendar.threading.latency ", 250);
 
 // Enable support for multiple realms on one server with the payoff that you
 // will get multiple password dialogs (one for each calendar)
 pref("calendar.network.multirealm", false);
 
 // Set up user agent
 #expand pref("calendar.useragent.extra", "Lightning/__LIGHTNING_VERSION__");
--- a/calendar/providers/caldav/calDavCalendar.js
+++ b/calendar/providers/caldav/calDavCalendar.js
@@ -2476,17 +2476,17 @@ calDavCalendar.prototype = {
                 if (status.substr(0, 3) != "2.0") {
                     cal.LOG("CalDAV: Got status " + status + " in response to " +
                             "freebusy query for" + self.name);
                 }
 
                 let caldata = caldavXPathFirst(fbResult, "/C:schedule-response/C:response/C:calendar-data/text()");
                 try {
                     let calComp = cal.getIcsService().parseICS(caldata, null);
-                    for (let calFbComp of cal.ical.calendarComponentIterator(calComp)) {
+                    for (let calFbComp of cal.iterate.icalComponent(calComp)) {
                         let interval;
 
                         let replyRangeStart = calFbComp.startTime;
                         if (replyRangeStart && (aRangeStart.compare(replyRangeStart) == -1)) {
                             interval = new cal.provider.FreeBusyInterval(aCalId,
                                                                          calIFreeBusyInterval.UNKNOWN,
                                                                          aRangeStart,
                                                                          replyRangeStart);
@@ -2496,17 +2496,17 @@ calDavCalendar.prototype = {
                         if (replyRangeEnd && (aRangeEnd.compare(replyRangeEnd) == 1)) {
                             interval = new cal.provider.FreeBusyInterval(aCalId,
                                                                          calIFreeBusyInterval.UNKNOWN,
                                                                          replyRangeEnd,
                                                                          aRangeEnd);
                             periodsToReturn.push(interval);
                         }
 
-                        for (let fbProp of cal.ical.propertyIterator(calFbComp, "FREEBUSY")) {
+                        for (let fbProp of cal.iterate.icalProperty(calFbComp, "FREEBUSY")) {
                             let fbType = fbProp.getParameter("FBTYPE");
                             if (fbType) {
                                 fbType = fbTypeMap[fbType];
                             } else {
                                 fbType = calIFreeBusyInterval.BUSY;
                             }
                             let parts = fbProp.value.split("/");
                             let begin = cal.createDateTime(parts[0]);
--- a/calendar/providers/memory/calMemoryCalendar.js
+++ b/calendar/providers/memory/calMemoryCalendar.js
@@ -438,32 +438,32 @@ calMemoryCalendar.prototype = {
             //  OR offline_journal == :offline_journal
 
             return (!reqFlag &&
                     (!itemFlag ||
                      itemFlag != cICL.OFFLINE_FLAG_DELETED_RECORD)) ||
                    itemFlag == reqFlag;
         };
 
-        cal.forEach(this.mItems, ([id, item]) => {
+        cal.iterate.forEach(this.mItems, ([id, item]) => {
             let isEvent_ = cal.item.isEvent(item);
             if (isEvent_) {
                 if (!wantEvents) {
-                    return cal.forEach.CONTINUE;
+                    return cal.iterate.forEach.CONTINUE;
                 }
             } else if (!wantTodos) {
-                return cal.forEach.CONTINUE;
+                return cal.iterate.forEach.CONTINUE;
             }
 
             let hasItemFlag = (item.id in this.mOfflineFlags);
             let itemFlag = (hasItemFlag ? this.mOfflineFlags[item.id] : 0);
 
             // If the offline flag doesn't match, skip the item
             if (!matchOffline(itemFlag, requestedFlag)) {
-                return cal.forEach.CONTINUE;
+                return cal.iterate.forEach.CONTINUE;
             }
 
             if (itemReturnOccurrences && item.recurrenceInfo) {
                 let startDate = aRangeStart;
                 if (!aRangeStart && cal.item.isToDo(item)) {
                     startDate = item.entryDate;
                 }
                 let occurrences = item.recurrenceInfo.getOccurrences(
@@ -478,19 +478,19 @@ calMemoryCalendar.prototype = {
             } else if ((!wantUnrespondedInvitations || checkUnrespondedInvitation(item)) &&
                        (isEvent_ || checkCompleted(item)) &&
                        cal.item.checkIfInRange(item, aRangeStart, aRangeEnd)) {
                 // This needs fixing for recurring items, e.g. DTSTART of parent may occur before aRangeStart.
                 // This will be changed with bug 416975.
                 itemsFound.push(item);
             }
             if (aCount && itemsFound.length >= aCount) {
-                return cal.forEach.BREAK;
+                return cal.iterate.forEach.BREAK;
             }
-            return cal.forEach.CONTINUE;
+            return cal.iterate.forEach.CONTINUE;
         }, () => {
             aListener.onGetResult(this.superCalendar,
                                   Components.results.NS_OK,
                                   typeIID,
                                   null,
                                   itemsFound.length,
                                   itemsFound);
             this.notifyOperationComplete(aListener,
--- a/calendar/providers/wcap/calWcapCalendarItems.js
+++ b/calendar/providers/wcap/calWcapCalendarItems.js
@@ -824,17 +824,17 @@ calWcapCalendar.prototype.parseItems = f
             break;
         case calICalendar.ITEM_FILTER_TYPE_EVENT:
             componentType = "VEVENT";
             break;
     }
 
     let recurrenceBound = this.session.recurrenceBound;
 
-    for (let subComp of cal.ical.calendarComponentIterator(icalRootComp, componentType)) {
+    for (let subComp of cal.iterate.icalComponent(icalRootComp, componentType)) {
         let organizer = subComp.getFirstProperty("ORGANIZER");
         if (organizer && organizer.getParameter("SENT-BY")) { // has SENT-BY
             // &emailorcalid=1 sets wrong email, workaround setting calid...
             let id = organizer.getParameter("X-S1CS-CALID");
             if (id) {
                 organizer.value = id;
             }
         }
--- a/calendar/providers/wcap/calWcapSession.js
+++ b/calendar/providers/wcap/calWcapSession.js
@@ -664,17 +664,17 @@ calWcapSession.prototype = {
     installServerTimezones: function(sessionId, request) {
         this.m_serverTimezones = {};
         this.issueNetworkRequest_(
             request,
             (err, data) => {
                 if (err) {
                     throw err;
                 }
-                for (let subComp of cal.ical.calendarComponentIterator(data, "VTIMEZONE")) {
+                for (let subComp of cal.iterate.icalComponent(data, "VTIMEZONE")) {
                     try {
                         let tzid = subComp.getFirstProperty("TZID").value;
                         this.m_serverTimezones[tzid] = new calWcapTimezone(this, tzid, subComp);
                     } catch (exc) { // ignore but errors:
                         logError(exc, this);
                     }
                 }
                 log("installed timezones.", this);