Bug 1280898 - Set up eslint for calendar files - enable prefer-arrow-callback rule. r=MakeMyDay
authoreslint <eslint@bugzilla.kewis.ch>
Fri, 08 Jul 2016 14:10:46 +0200
changeset 26009 e6a3cd0ad1e007cea30628f9cb96ba9085162329
parent 26008 d0755bd52da8189fbed8fa4b7496f29bc1854289
child 26010 b5c1c8200552235f35285203c24784399dc993d8
push id1771
push userclokep@gmail.com
push dateMon, 14 Nov 2016 17:47:53 +0000
treeherdercomm-beta@399ae9d71595 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMakeMyDay
bugs1280898
Bug 1280898 - Set up eslint for calendar files - enable prefer-arrow-callback rule. r=MakeMyDay MozReview-Commit-ID: E3n4RPWNDWu
calendar/.eslintrc
calendar/base/content/agenda-listbox.js
calendar/base/content/calendar-chrome-startup.js
calendar/base/content/calendar-invitations-manager.js
calendar/base/content/calendar-multiday-view.xml
calendar/base/content/calendar-task-tree.js
calendar/base/content/calendar-task-tree.xml
calendar/base/content/calendar-ui-utils.js
calendar/base/content/calendar-unifinder.js
calendar/base/content/calendar-views.js
calendar/base/content/dialogs/calendar-dialog-utils.js
calendar/base/content/dialogs/calendar-event-dialog-attendees.js
calendar/base/content/dialogs/calendar-event-dialog-reminder.js
calendar/base/content/dialogs/calendar-print-dialog.js
calendar/base/modules/calItipUtils.jsm
calendar/base/modules/calProviderUtils.jsm
calendar/base/modules/calRecurrenceUtils.jsm
calendar/base/modules/calUtils.jsm
calendar/base/modules/calXMLUtils.jsm
calendar/base/src/calAlarmMonitor.js
calendar/base/src/calCachedCalendar.js
calendar/base/src/calCalendarManager.js
calendar/base/src/calDefaultACLManager.js
calendar/base/src/calFilter.js
calendar/base/src/calIcsParser.js
calendar/base/src/calItipItem.js
calendar/base/src/calRecurrenceInfo.js
calendar/base/src/calTimezone.js
calendar/import-export/calHtmlExport.js
calendar/import-export/calOutlookCSVImportExport.js
calendar/lightning/components/calItipProtocolHandler.js
calendar/lightning/content/lightning-item-iframe.js
calendar/lightning/content/messenger-overlay-sidebar.js
calendar/lightning/content/suite-overlay-sidebar.js
calendar/providers/composite/calCompositeCalendar.js
calendar/providers/ics/calICSCalendar.js
calendar/providers/wcap/calWcapCalendar.js
calendar/providers/wcap/calWcapCalendarItems.js
calendar/providers/wcap/calWcapRequest.js
calendar/providers/wcap/calWcapSession.js
calendar/test/mozmill/eventDialog/testEventDialog.js
calendar/test/mozmill/eventDialog/testUTF8.js
calendar/test/mozmill/recurrence/testAnnualRecurrence.js
calendar/test/mozmill/recurrence/testBiweeklyRecurrence.js
calendar/test/mozmill/recurrence/testDailyRecurrence.js
calendar/test/mozmill/recurrence/testLastDayOfMonthRecurrence.js
calendar/test/mozmill/recurrenceRotated/testAnnualRecurrence.js
calendar/test/mozmill/recurrenceRotated/testBiweeklyRecurrence.js
calendar/test/mozmill/recurrenceRotated/testDailyRecurrence.js
calendar/test/mozmill/recurrenceRotated/testLastDayOfMonthRecurrence.js
calendar/test/mozmill/recurrenceRotated/testWeeklyNRecurrence.js
calendar/test/mozmill/recurrenceRotated/testWeeklyUntilRecurrence.js
calendar/test/mozmill/recurrenceRotated/testWeeklyWithExceptionRecurrence.js
calendar/test/mozmill/shared-modules/calendar-utils.js
calendar/test/mozmill/testLocalICS.js
calendar/test/mozmill/testTodayPane.js
calendar/test/mozmill/views/testDayView.js
calendar/test/mozmill/views/testMonthView.js
calendar/test/mozmill/views/testMultiweekView.js
calendar/test/mozmill/views/testTaskView.js
calendar/test/mozmill/views/testWeekView.js
calendar/test/unit/test_alarm.js
calendar/test/unit/test_alarmservice.js
calendar/test/unit/test_attachment.js
calendar/test/unit/test_attendee.js
calendar/test/unit/test_bug350845.js
calendar/test/unit/test_deleted_items.js
calendar/test/unit/test_freebusy.js
calendar/test/unit/test_gdata_provider.js
calendar/test/unit/test_ics.js
calendar/test/unit/test_items.js
calendar/test/unit/test_relation.js
calendar/test/unit/test_storage.js
calendar/test/unit/test_webcal.js
--- a/calendar/.eslintrc
+++ b/calendar/.eslintrc
@@ -415,13 +415,16 @@
     }],
 
     // Disallow unnecessary concatenation of strings
     "no-useless-concat": 2,
 
     // Disallow unmodified conditions of loops
     "no-unmodified-loop-condition": 2,
 
+    // Suggest using arrow functions as callbacks
+    "prefer-arrow-callback": [2, { "allowNamedFunctions": true }],
+
     // The following rules will not be enabled currently, but are kept here for
     // easier updates in the future.
     "no-else-return": 0,
   }
 }
--- a/calendar/base/content/agenda-listbox.js
+++ b/calendar/base/content/agenda-listbox.js
@@ -45,23 +45,20 @@ agendaListbox.init = function() {
                     agendaListbox.updateSoonSection();
                     break;
             }
         }
     };
     Services.prefs.addObserver("calendar.agendaListbox", prefObserver, false);
 
     // Make sure the agenda listbox is unloaded
-    let self = this;
-    window.addEventListener("unload",
-                            function() {
-                                Services.prefs.removeObserver("calendar.agendaListbox", prefObserver);
-                                self.uninit();
-                            },
-                            false);
+    window.addEventListener("unload", () => {
+        Services.prefs.removeObserver("calendar.agendaListbox", prefObserver);
+        this.uninit();
+    }, false);
 };
 
 /**
  * Clean up the agenda listbox, used on window unload.
  */
 agendaListbox.uninit = function() {
     if (this.calendar) {
         this.calendar.removeObserver(this.calendarObserver);
@@ -1094,20 +1091,19 @@ function scheduleNextCurrentEventUpdate(
                    aRefreshCallback();
                }
            }
         };
         // Add observer
         Services.obs.addObserver(wakeObserver, "wake_notification", false);
 
         // Remove observer on unload
-        window.addEventListener("unload",
-                                function() {
-                                    Services.obs.removeObserver(wakeObserver, "wake_notification");
-                                }, false);
+        window.addEventListener("unload", () => {
+            Services.obs.removeObserver(wakeObserver, "wake_notification");
+        }, false);
 
         gEventTimer = Components.classes["@mozilla.org/timer;1"]
                                    .createInstance(Components.interfaces.nsITimer);
     } else {
         gEventTimer.cancel();
     }
     gEventTimer.initWithCallback(udCallback, aMsUntil, gEventTimer.TYPE_ONE_SHOT);
 }
--- a/calendar/base/content/calendar-chrome-startup.js
+++ b/calendar/base/content/calendar-chrome-startup.js
@@ -132,17 +132,17 @@ var calendarWindowPrefs = {
                     for (let win in fixIterator(Services.ww.getWindowEnumerator())) {
                         setElementValue(win.document.documentElement, attributeValue, "systemcolors");
                     }
                     break;
                 }
             }
         } else if (aTopic == "domwindowopened") {
             let win = aSubject.QueryInterface(Components.interfaces.nsIDOMWindow);
-            win.addEventListener("load", function() {
+            win.addEventListener("load", () => {
                 let attributeValue = Preferences.get("calendar.view.useSystemColors", false) && "true";
                 setElementValue(win.document.documentElement, attributeValue, "systemcolors");
             }, false);
         }
     }
 };
 
 /**
--- a/calendar/base/content/calendar-invitations-manager.js
+++ b/calendar/base/content/calendar-invitations-manager.js
@@ -63,20 +63,19 @@ function getInvitationsManager() {
  * @constructor
  */
 function InvitationsManager() {
     this.mItemList = [];
     this.mStartDate = null;
     this.mJobsPending = 0;
     this.mTimer = null;
 
-    let self = this;
-    window.addEventListener("unload", function() {
+    window.addEventListener("unload", () => {
         // Unload handlers get removed automatically
-        self.cancelInvitationsUpdate();
+        this.cancelInvitationsUpdate();
     }, false);
 }
 
 InvitationsManager.prototype = {
     mItemList: null,
     mStartDate: null,
     mJobsPending: 0,
     mTimer: null,
--- a/calendar/base/content/calendar-multiday-view.xml
+++ b/calendar/base/content/calendar-multiday-view.xml
@@ -884,26 +884,25 @@
               if (startComparison != 0) {
                   return startComparison;
               } else {
                   // If the items start at the same time, return the longer one
                   // first
                   return bEventInfo.layoutEnd.compare(aEventInfo.layoutEnd);
               }
           }
-          let self = this;
-          this.mEventInfos.forEach(function(aEventInfo) {
+          this.mEventInfos.forEach((aEventInfo) => {
               let item = aEventInfo.event.clone();
               let start = item.startDate || item.entryDate || item.dueDate;
-              start = start.getInTimezone(self.mTimezone);
+              start = start.getInTimezone(this.mTimezone);
               aEventInfo.layoutStart = start;
               let end = item.endDate || item.dueDate || item.entryDate;
-              end = end.getInTimezone(self.mTimezone);
+              end = end.getInTimezone(this.mTimezone);
               let secEnd = start.clone();
-              secEnd.addDuration(self.mMinDuration);
+              secEnd.addDuration(this.mMinDuration);
               if (secEnd.nativeTime > end.nativeTime) {
                    aEventInfo.layoutEnd = secEnd;
               } else {
                    aEventInfo.layoutEnd = end;
               }
               return aEventInfo;
           });
           this.mEventInfos.sort(sortByStart);
@@ -1422,21 +1421,21 @@
               scrollBy *= -1;
           } else if (diffEnd < SCROLLZONE) {
               insideScrollZone = SCROLLZONE - diffEnd;
           }
 
           if (insideScrollZone) {
               let sbo = scrollbox.boxObject;
               let timeout = MAXTIMEOUT - insideScrollZone * (MAXTIMEOUT - MINTIMEOUT) / SCROLLZONE;
-              this.mMagicScrollTimer = setTimeout(function() {
+              this.mMagicScrollTimer = setTimeout(() => {
                   sbo.scrollBy(orient == "horizontal" && scrollBy,
                                orient == "vertical" && scrollBy);
                   this.onEventSweepMouseMove(event);
-              }.bind(this), timeout);
+              }, timeout);
           }
         ]]></body>
       </method>
 
       <!--
          - Event sweep handlers
         -->
       <method name="onEventSweepMouseMove">
@@ -2714,17 +2713,17 @@
           }
           let ppm = size / self.mVisibleMinutes;
           ppm = Math.floor(ppm * 1000) / 1000;
           if (ppm < self.mMinPixelsPerMinute) {
               ppm = self.mMinPixelsPerMinute;
           }
           let ppmChanged = (self.pixelsPerMinute != ppm);
           self.pixelsPerMinute = ppm;
-          setTimeout(function() { self.scrollToMinute(self.mFirstVisibleMinute); }, 0);
+          setTimeout(() => self.scrollToMinute(self.mFirstVisibleMinute), 0);
 
           // Fit the weekday labels while scrolling.
           self.adjustWeekdayLength(self.getAttribute("orient") == "horizontal");
 
           // Adjust the time indicator position and the related timer.
           if (this.mTimeIndicatorInterval != 0) {
               let viewChanged = isARelayout && (timeIndicator.lastView != this.id);
               let currentMode = document.getElementById("modeBroadcaster").getAttribute("mode");
@@ -3532,19 +3531,17 @@
               if (startDate.compare(this.mStartDate) >= 0 &&
                   endDate.compare(this.mEndDate) <= 0) {
                   for (let i = startDate.day; i <= endDate.day; i++) {
                       occMap[i] = true;
                   }
               }
           }
 
-          return this.mDateColumns.filter(function(col) {
-              return (col.date.day in occMap);
-          });
+          return this.mDateColumns.filter(col => col.date.day in occMap);
         ]]></body>
       </method>
 
       <method name="findColumnsForItem">
         <parameter name="aItem"/>
         <body><![CDATA[
           let columns = [];
 
--- a/calendar/base/content/calendar-task-tree.js
+++ b/calendar/base/content/calendar-task-tree.js
@@ -212,17 +212,17 @@ function contextPostponeTask(aEvent, aDu
     }
 
     if (gTabmail && gTabmail.currentTabInfo.mode.type == "calendarTask") {
         postponeTask(aDuration);
     } else {
         startBatchTransaction();
         let tasks = getSelectedTasks(aEvent);
 
-        tasks.forEach(function(task) {
+        tasks.forEach((task) => {
             if (task.entryDate || task.dueDate) {
                 let newTask = task.clone();
                 cal.shiftItem(newTask, duration);
                 doTransaction("modify", newTask, newTask.calendar, task, null);
             }
         });
 
         endBatchTransaction();
--- a/calendar/base/content/calendar-task-tree.xml
+++ b/calendar/base/content/calendar-task-tree.xml
@@ -145,20 +145,17 @@
         let ordinals = this.getAttribute("ordinals").split(" ");
         let widths = this.getAttribute("widths").split(" ");
         let sorted = this.getAttribute("sort-active");
         let sortDirection = this.getAttribute("sort-direction") || "ascending";
         tree = document.getAnonymousNodes(this)[0];
         let treecols = tree.getElementsByTagNameNS(tree.namespaceURI, "treecol");
         for (let i = 0; i < treecols.length; i++) {
             let content = treecols[i].getAttribute("itemproperty");
-            if (names.some(
-                function(element) {
-                    return (element == content);
-                })) {
+            if (names.some(element => element == content)) {
                 treecols[i].removeAttribute("hidden");
             } else {
                 treecols[i].setAttribute("hidden", "true");
             }
             if (ordinals && ordinals.length > 0) {
                treecols[i].ordinal = Number(ordinals.shift());
             }
             if (widths && widths.length > 0) {
@@ -922,20 +919,17 @@
               items: null,
               operation: null,
 
               onOperationComplete: function(aOpCalendar, aStatus, aOperationType, aId, aDateTime) {
                   if (aOpCalendar.id in this.binding.mPendingRefreshJobs) {
                       delete this.binding.mPendingRefreshJobs[aOpCalendar.id];
                   }
 
-                  let oldItems = this.binding.mTaskArray.filter(function(item) {
-                      return item.calendar.id == aOpCalendar.id;
-                  });
-
+                  let oldItems = this.binding.mTaskArray.filter(item => item.calendar.id == aOpCalendar.id);
                   this.binding.mTreeView.modifyItems(this.items, oldItems);
               },
 
               onGetResult: function(aOpCalendar, aStatus, aItemType, aDetail, aCount, aItems) {
                   this.items = this.items.concat(aItems);
               },
 
               cancel: function() {
@@ -996,19 +990,17 @@
                 this.refreshFromCalendar(aCalendar, aFilter);
             }
         ]]></body>
       </method>
 
       <method name="onCalendarRemoved">
         <parameter name="aCalendar"/>
         <body><![CDATA[
-            let tasks = this.mTaskArray.filter(function(task) {
-                return task.calendar.id == aCalendar.id;
-            });
+            let tasks = this.mTaskArray.filter(task => task.calendar.id == aCalendar.id);
             this.mTreeView.removeItems(tasks);
         ]]></body>
       </method>
 
       <method name="sortItems">
         <body><![CDATA[
           if (this.mTreeView.selectedColumn) {
               let modifier = (this.mTreeView.sortDirection == "descending" ? -1 : 1);
--- a/calendar/base/content/calendar-ui-utils.js
+++ b/calendar/base/content/calendar-ui-utils.js
@@ -257,17 +257,17 @@ function sortCalendarArray(calendars) {
             return 1;
         }
         return 0;
     }
     ret.sort(sortFunc);
 
     // check and repair pref:
     let sortOrderString = Preferences.get("calendar.list.sortOrder", "");
-    let wantedOrderString = ret.map(function(c) { return c.id; }).join(" ");
+    let wantedOrderString = ret.map(c => c.id).join(" ");
     if (wantedOrderString != sortOrderString) {
         Preferences.set("calendar.list.sortOrder", wantedOrderString);
     }
 
     return ret;
 }
 
 /**
--- a/calendar/base/content/calendar-unifinder.js
+++ b/calendar/base/content/calendar-unifinder.js
@@ -639,17 +639,17 @@ var unifinderTreeView = {
             // If there is more than one item, just select them all.
             for (let item of aItemArray) {
                 let row = this.getItemRow(item);
                 this.tree.view.selection.rangedSelect(row, row, true);
             }
         }
 
         // This needs to be in a setTimeout
-        setTimeout(function() { unifinderTreeView.resetAllowSelection(); }, 1);
+        setTimeout(() => unifinderTreeView.resetAllowSelection(), 1);
     },
 
     /**
      * Due to a selection issue described in bug 168211 this method is needed to
      * re-add the selection listeners selection listeners.
      */
     resetAllowSelection: function() {
         if (!this.tree) {
--- a/calendar/base/content/calendar-views.js
+++ b/calendar/base/content/calendar-views.js
@@ -115,17 +115,17 @@ var calendarViewController = {
         };
 
         // Make sure we are modifying a copy of aOccurrences, otherwise we will
         // run into race conditions when the view's doDeleteItem removes the
         // array elements while we are iterating through them. While we are at
         // it, filter out any items that have readonly calendars, so that
         // checking for one total item below also works out if all but one item
         // are readonly.
-        let occurrences = aOccurrences.filter(function(item) { return isCalendarWritable(item.calendar); });
+        let occurrences = aOccurrences.filter(item => isCalendarWritable(item.calendar));
 
         for (let itemToDelete of occurrences) {
             if (aUseParentItems) {
                 // Usually happens when ctrl-click is used. In that case we
                 // don't need to ask the user if he wants to delete an
                 // occurrence or not.
                 itemToDelete = itemToDelete.parentItem;
             } else if (!aDoNotConfirm && occurrences.length == 1) {
@@ -213,17 +213,17 @@ function switchToView(aViewType) {
     }
 
     // Set up the labels and accesskeys for the context menu
     ["calendar-view-context-menu-next",
      "calendar-view-context-menu-previous",
      "calendar-go-menu-next",
      "calendar-go-menu-previous",
      "appmenu_calendar-go-menu-next",
-     "appmenu_calendar-go-menu-previous"].forEach(function(x) {
+     "appmenu_calendar-go-menu-previous"].forEach((x) => {
             setupViewNode(x, "label");
             setupViewNode(x, "accesskey");
      });
 
     // Set up the labels for the view navigation
     ["previous-view-button",
      "today-view-button",
      "next-view-button"].forEach(x => setupViewNode(x, "tooltiptext"));
@@ -331,20 +331,19 @@ function scheduleMidnightUpdate(aRefresh
                }
            }
         };
 
         // Add observer
         Services.obs.addObserver(wakeObserver, "wake_notification", false);
 
         // Remove observer on unload
-        window.addEventListener("unload",
-                                function() {
-                                    Services.obs.removeObserver(wakeObserver, "wake_notification");
-                                }, false);
+        window.addEventListener("unload", () => {
+            Services.obs.removeObserver(wakeObserver, "wake_notification");
+        }, false);
         gMidnightTimer = Components.classes["@mozilla.org/timer;1"]
                                    .createInstance(Components.interfaces.nsITimer);
     } else {
         gMidnightTimer.cancel();
     }
     gMidnightTimer.initWithCallback(udCallback, msUntilTomorrow, gMidnightTimer.TYPE_ONE_SHOT);
 }
 
@@ -707,18 +706,17 @@ cal.navigationBar = {
 };
 
 /*
  * Timer for the time indicator in day and week view.
  */
 var timeIndicator = {
     timer: null,
     start: function(aInterval, aThis) {
-        timeIndicator.timer = setInterval(function() { aThis.updateTimeIndicatorPosition(false); },
-                                          aInterval * 1000);
+        timeIndicator.timer = setInterval(() => aThis.updateTimeIndicatorPosition(false), aInterval * 1000);
     },
     cancel: function() {
         if (timeIndicator.timer) {
             clearTimeout(timeIndicator.timer);
             timeIndicator.timer = null;
         }
     },
     lastView: null
--- a/calendar/base/content/dialogs/calendar-dialog-utils.js
+++ b/calendar/base/content/dialogs/calendar-dialog-utils.js
@@ -541,20 +541,20 @@ function updateLink() {
             return;
         }
 
         // Only show if its either an internal protcol handler, or its external
         // and there is an external app for the scheme
         handler = cal.wrapInstance(handler, Components.interfaces.nsIExternalProtocolHandler);
         hideOrShow(!handler || handler.externalAppExistsForScheme(uri.scheme));
 
-        setTimeout(function() {
-          // HACK the url-link doesn't crop when setting the value in onLoad
-          setElementValue("url-link", itemUrlString);
-          setElementValue("url-link", itemUrlString, "href");
+        setTimeout(() => {
+            // HACK the url-link doesn't crop when setting the value in onLoad
+            setElementValue("url-link", itemUrlString);
+            setElementValue("url-link", itemUrlString, "href");
         }, 0);
     }
 }
 
 /*
  * setup attendees in event and summary dialog
  */
 function setupAttendees() {
--- a/calendar/base/content/dialogs/calendar-event-dialog-attendees.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-attendees.js
@@ -115,21 +115,19 @@ function onLoad() {
                 case "calendar.view.dayendhour":
                     initTimeRange();
                     propagateDateTime();
                     break;
             }
         }
     };
     Services.prefs.addObserver("calendar.", prefObserver, false);
-    window.addEventListener("unload",
-        function() {
-            Services.prefs.removeObserver("calendar.", prefObserver);
-        },
-        false);
+    window.addEventListener("unload", () => {
+        Services.prefs.removeObserver("calendar.", prefObserver);
+    }, false);
 
     opener.setCursor("auto");
     self.focus();
 }
 
 /**
  * This function should be called when the accept button was pressed on the
  * attendee dialog. Calls the accept function specified in the window arguments.
--- a/calendar/base/content/dialogs/calendar-event-dialog-reminder.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-reminder.js
@@ -97,17 +97,17 @@ function loadReminders() {
     let absDate = document.getElementById("reminder-absolute-date");
     absDate.value = cal.dateTimeToJsDate(getDefaultStartDate());
 
     if (listbox.childNodes.length) {
         // We have reminders, select the first by default. For some reason,
         // setting the selected index in a load handler makes the selection
         // break for the set item, therefore we need a setTimeout.
         setupMaxReminders();
-        setTimeout(function() { listbox.selectedIndex = 0; }, 0);
+        setTimeout(() => { listbox.selectedIndex = 0; }, 0);
     } else {
         // Make sure the fields are disabled if we have no alarms
         setupRadioEnabledState(true);
     }
 }
 
 /**
  * Sets up the enabled state of the reminder details controls. Used when
--- a/calendar/base/content/dialogs/calendar-print-dialog.js
+++ b/calendar/base/content/dialogs/calendar-print-dialog.js
@@ -90,17 +90,17 @@ function getPrintSettings(receiverFunc) 
         settings.start = theView.startDay.clone();
         settings.end = theView.endDay.clone();
         settings.end.day += 1;
         settings.start.isDate = false;
         settings.end.isDate = false;
         break;
     case "selected": {
         let selectedItems = theView.getSelectedItems({});
-        settings.eventList = selectedItems.filter(function(item) {
+        settings.eventList = selectedItems.filter((item) => {
             if (cal.isEvent(item) && !settings.printEvents) {
                 return false;
             }
             if (cal.isToDo(item) && !settings.printTasks) {
                 return false;
             }
             return true;
         });
--- a/calendar/base/modules/calItipUtils.jsm
+++ b/calendar/base/modules/calItipUtils.jsm
@@ -434,20 +434,17 @@ cal.itip = {
 
         if (needsCalendar) {
             let calendars = cal.getCalendarManager().getCalendars({}).filter(cal.itip.isSchedulingCalendar);
 
             if (aItipItem.receivedMethod == "REQUEST") {
                 // try to further limit down the list to those calendars that
                 // are configured to a matching attendee;
                 let item = aItipItem.getItemList({})[0];
-                let matchingCals = calendars.filter(
-                    function(calendar) {
-                        return (cal.getInvitedAttendee(item, calendar) != null);
-                    });
+                let matchingCals = calendars.filter(calendar => cal.getInvitedAttendee(item, calendar) != null);
                 // if there's none, we will show the whole list of calendars:
                 if (matchingCals.length > 0) {
                     calendars = matchingCals;
                 }
             }
 
             if (calendars.length == 0) {
                 let msg = cal.calGetString("lightning", "imipNoCalendarAvailable", null, "lightning");
@@ -560,23 +557,22 @@ cal.itip = {
             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({})) {
                     let wrappedRItem = cal.wrapInstance(ritem, Components.interfaces.calIRecurrenceDate);
                     if (ritem.isNegative &&
                         wrappedRItem &&
-                        !aOriginalItem.recurrenceInfo.getRecurrenceItems({}).some(
-                            function(r) {
-                                let wrappedR = cal.wrapInstance(r, Components.interfaces.calIRecurrenceDate);
-                                return r.isNegative &&
-                                       wrappedR &&
-                                       wrappedR.date.compare(wrappedRItem.date) == 0;
-                            })) {
+                        !aOriginalItem.recurrenceInfo.getRecurrenceItems({}).some((r) => {
+                            let wrappedR = cal.wrapInstance(r, Components.interfaces.calIRecurrenceDate);
+                            return r.isNegative &&
+                                   wrappedR &&
+                                   wrappedR.date.compare(wrappedRItem.date) == 0;
+                        })) {
                         exdates.push(wrappedRItem);
                     }
                 }
                 if (exdates.length > 0) {
                     // check whether really only EXDATEs have been added:
                     let recInfo = clonedItem.recurrenceInfo;
                     exdates.forEach(recInfo.deleteRecurrenceItem, recInfo);
                     if (cal.compareItemContent(clonedItem, aOriginalItem)) { // transition into "delete occurrence(s)"
@@ -894,21 +890,20 @@ function stripUserData(item_) {
     let propEnum = item.propertyEnumerator;
     while (propEnum.hasMoreElements()) {
         let prop = propEnum.getNext().QueryInterface(Components.interfaces.nsIProperty);
         let pname = prop.name;
         if (pname.substr(0, "X-MOZ-".length) == "X-MOZ-") {
             item.deleteProperty(prop.name);
         }
     }
-    item.getAttendees({}).forEach(
-        function(att) {
-            att.deleteProperty("RECEIVED-SEQUENCE");
-            att.deleteProperty("RECEIVED-DTSTAMP");
-        });
+    item.getAttendees({}).forEach((att) => {
+        att.deleteProperty("RECEIVED-SEQUENCE");
+        att.deleteProperty("RECEIVED-DTSTAMP");
+    });
     item.setProperty("DTSTAMP", stamp);
     item.setProperty("LAST-MODIFIED", lastModified); // need to be last to undirty the item
     return item;
 }
 
 /** local to this module file
  * Takes over relevant item information from iTIP item and sets received info.
  *
@@ -1332,17 +1327,17 @@ ItipItemFinder.prototype = {
                                             // are viewing the current representation of the item, show the
                                             // accept/decline buttons. This means newer events will show the
                                             // "Update" button and older events will show the "already
                                             // processed" text.
                                             if (foundAttendee.participationStatus == "NEEDS-ACTION" &&
                                                 (item.calendar.getProperty("itip.disableRevisionChecks") ||
                                                  cal.itip.compare(itipItemItem, item) == 0)) {
                                                 actionMethod = "REQUEST:NEEDS-ACTION";
-                                                operations.push(function(opListener, partStat) {
+                                                operations.push((opListener, partStat) => {
                                                     let changedItem = firstFoundItem.clone();
                                                     changedItem.removeAttendee(foundAttendee);
                                                     foundAttendee = foundAttendee.clone();
                                                     if (partStat) {
                                                         foundAttendee.participationStatus = partStat;
                                                     }
                                                     changedItem.addAttendee(foundAttendee);
 
@@ -1352,17 +1347,17 @@ ItipItemFinder.prototype = {
                                             } else if (item.calendar.getProperty("itip.disableRevisionChecks") ||
                                                        cal.itip.compare(itipItemItem, item) > 0) {
                                                 addScheduleAgentClient(newItem, item.calendar);
 
                                                 let isMinorUpdate = (cal.itip.getSequence(newItem) ==
                                                                      cal.itip.getSequence(item));
                                                 actionMethod = (isMinorUpdate ? method + ":UPDATE-MINOR"
                                                                               : method + ":UPDATE");
-                                                operations.push(function(opListener, partStat) {
+                                                operations.push((opListener, partStat) => {
                                                     if (!partStat) { // keep PARTSTAT
                                                         let att_ = cal.getInvitedAttendee(item);
                                                         partStat = (att_ ? att_.participationStatus : "NEEDS-ACTION");
                                                     }
                                                     newItem.removeAttendee(att);
                                                     att = att.clone();
                                                     att.participationStatus = partStat;
                                                     newItem.addAttendee(att);
@@ -1417,34 +1412,25 @@ ItipItemFinder.prototype = {
                                     let newItem = modifiedItems[item.id];
                                     if (!newItem) {
                                         newItem = item.clone();
                                         modifiedItems[item.id] = newItem;
 
                                         // Make sure the provider-specified properties are copied over
                                         copyProviderProperties(this.mItipItem, itipItemItem, newItem);
 
-                                        operations.push(
-                                            function(opListener) {
-                                                return newItem.calendar.modifyItem(newItem, item, opListener);
-                                            });
+                                        operations.push(opListener => newItem.calendar.modifyItem(newItem, item, opListener));
                                     }
                                     newItem.recurrenceInfo.removeOccurrenceAt(rid);
                                 } else if (item.recurrenceId && (item.recurrenceId.compare(rid) == 0)) {
                                     // parentless occurrence to be deleted (future)
-                                    operations.push(
-                                        function(opListener) {
-                                            return item.calendar.deleteItem(item, opListener);
-                                        });
+                                    operations.push(opListener => item.calendar.deleteItem(item, opListener));
                                 }
                             } else {
-                                operations.push(
-                                    function(opListener) {
-                                        return item.calendar.deleteItem(item, opListener);
-                                    });
+                                operations.push(opListener => item.calendar.deleteItem(item, opListener));
                             }
                         }
                     }
                     break;
                 }
                 default:
                     rc = Components.results.NS_ERROR_NOT_IMPLEMENTED;
                     break;
--- a/calendar/base/modules/calProviderUtils.jsm
+++ b/calendar/base/modules/calProviderUtils.jsm
@@ -234,26 +234,26 @@ cal.getImipTransport = function(aCalenda
 cal.getEmailIdentityOfCalendar = function(aCalendar, outAccount) {
     cal.ASSERT(aCalendar, "no calendar!", Components.results.NS_ERROR_INVALID_ARG);
     let key = aCalendar.getProperty("imip.identity.key");
     if (key !== null) {
         if (key.length == 0) { // i.e. "None"
             return null;
         }
         let identity = null;
-        cal.calIterateEmailIdentities(
-            function(identity_, account) {
-                if (identity_.key == key) {
-                    identity = identity_;
-                    if (outAccount) {
-                        outAccount.value = account;
-                    }
+        cal.calIterateEmailIdentities((identity_, account) => {
+            if (identity_.key == key) {
+                identity = identity_;
+                if (outAccount) {
+                    outAccount.value = account;
                 }
-                return (identity_.key != key);
-            });
+            }
+            return (identity_.key != key);
+        });
+
         if (!identity) {
             // dangling identity:
             cal.WARN("Calendar " + (aCalendar.uri ? aCalendar.uri.spec : aCalendar.id) +
                      " has a dangling E-Mail identity configured.");
         }
         return identity;
     } else { // take default account/identity:
         let findIdentity = function(account) {
--- a/calendar/base/modules/calRecurrenceUtils.jsm
+++ b/calendar/base/modules/calRecurrenceUtils.jsm
@@ -143,20 +143,20 @@ function recurrenceRule2String(recurrenc
                                 }
                                 weekdaysString_every += getRString(pluralWeekday("repeatDetailsDay" + byday[i])) + ", ";
                             } else {
                                 if (day_position(byday[i]) < -1 || day_position(byday[i]) > 5) {
                                     // We support only weekdays with -1 as negative
                                     // position ('THE LAST ...').
                                     return null;
                                 }
-                                if (byday.some(function(element) {
-                                                   return (day_position(element) == 0 &&
-                                                           day_of_week(byday[i]) == day_of_week(element));
-                                               })) {
+                                if (byday.some((element) => {
+                                                return (day_position(element) == 0 &&
+                                                        day_of_week(byday[i]) == day_of_week(element));
+                                                })) {
                                     // Prevent to build strings such as for example:
                                     // "every Monday and the second Monday...".
                                     continue;
                                 }
                                 let ordinalString = "repeatOrdinal" + day_position(byday[i]);
                                 let dayString = "repeatDetailsDay" + day_of_week(byday[i]);
                                 ordinalString = nounClass(dayString, ordinalString);
                                 ordinalString = getRString(ordinalString);
@@ -178,19 +178,17 @@ function recurrenceRule2String(recurrenc
                                                .replace("#2", rule.interval);
                     }
                 } else if (checkRecurrenceRule(rule, ["BYMONTHDAY"])) {
                     let component = rule.getComponent("BYMONTHDAY", {});
 
                     // First, find out if the 'BYMONTHDAY' component contains
                     // any elements with a negative value lesser than -1 ("the
                     // last day"). If so we currently don't support any rule
-                    if (component.some(function(element, index, array) {
-                                           return element < -1;
-                                       })) {
+                    if (component.some(element => element < -1)) {
                         // we don't support any other combination for now...
                         return getRString("ruleTooComplex");
                     } else if (component.length == 1 && component[0] == -1) {
                         // i.e. one day, the last day of the month
                         let monthlyString = getRString("monthlyLastDayOfNth");
                         ruleString = PluralForm.get(rule.interval, monthlyString)
                                                .replace("#1", rule.interval);
                     } else {
--- a/calendar/base/modules/calUtils.jsm
+++ b/calendar/base/modules/calUtils.jsm
@@ -933,26 +933,26 @@ var cal = {
 };
 
 // local to this module;
 // will be used to clean up global objects on shutdown
 // some objects have cyclic references due to wrappers
 function shutdownCleanup(obj, prop) {
     if (!shutdownCleanup.mEntries) {
         shutdownCleanup.mEntries = [];
-        cal.addShutdownObserver(function() {
-                for (let entry of shutdownCleanup.mEntries) {
-                    if (entry.mProp) {
-                        delete entry.mObj[entry.mProp];
-                    } else {
-                        delete entry.mObj;
-                    }
+        cal.addShutdownObserver(() => {
+            for (let entry of shutdownCleanup.mEntries) {
+                if (entry.mProp) {
+                    delete entry.mObj[entry.mProp];
+                } else {
+                    delete entry.mObj;
                 }
-                delete shutdownCleanup.mEntries;
-            });
+            }
+            delete shutdownCleanup.mEntries;
+        });
     }
     shutdownCleanup.mEntries.push({ mObj: obj, mProp: prop });
 }
 
 // local to this module;
 // will be used to generate service accessor functions
 function generateServiceAccessor(id, iface) {
     // eslint-disable-next-line func-names
--- a/calendar/base/modules/calXMLUtils.jsm
+++ b/calendar/base/modules/calXMLUtils.jsm
@@ -156,17 +156,17 @@ cal.xml.serializeDOM = function(doc) {
 /**
  * Escape a string for use in XML
  *
  * @param str           The string to escape
  * @param isAttribute   If true, " and ' are also escaped
  * @return              The escaped string
  */
 cal.xml.escapeString = function(str, isAttribute) {
-    return str.replace(/[&<>'"]/g, function(chr) {
+    return str.replace(/[&<>'"]/g, (chr) => {
         switch (chr) {
             case "&": return "&amp;";
             case "<": return "&lt;";
             case ">": return "&gt;";
             case '"': return (isAttribute ? "&quot;" : chr);
             case "'": return (isAttribute ? "&apos;" : chr);
             default: return chr;
         }
--- a/calendar/base/src/calAlarmMonitor.js
+++ b/calendar/base/src/calAlarmMonitor.js
@@ -143,30 +143,28 @@ calAlarmMonitor.prototype = {
             // Uh oh, it seems the alarms were removed even before the window
             // finished loading. Looks like we can close it again
             calAlarmWindow.closeIfEmpty();
         }
     },
 
     onRemoveAlarmsByItem: function(aItem) {
         let calAlarmWindow = peekAlarmWindow();
-        this.mAlarms = this.mAlarms.filter(function(itemAlarm) {
-            let [thisItem, alarm] = itemAlarm;
+        this.mAlarms = this.mAlarms.filter(([thisItem, alarm]) => {
             let ret = (aItem.hashId != thisItem.hashId);
             if (!ret && calAlarmWindow) { // window is open
                 calAlarmWindow.removeWidgetFor(thisItem, alarm);
             }
             return ret;
         });
     },
 
     onRemoveAlarmsByCalendar: function(calendar) {
         let calAlarmWindow = peekAlarmWindow();
-        this.mAlarms = this.mAlarms.filter(function(itemAlarm) {
-            let [thisItem, alarm] = itemAlarm;
+        this.mAlarms = this.mAlarms.filter(([thisItem, alarm]) => {
             let ret = (calendar.id != thisItem.calendar.id);
 
             if (!ret && calAlarmWindow) { // window is open
                 calAlarmWindow.removeWidgetFor(thisItem, alarm);
             }
             return ret;
         });
     },
--- a/calendar/base/src/calCachedCalendar.js
+++ b/calendar/base/src/calCachedCalendar.js
@@ -71,17 +71,17 @@ calCachedCalendarObserverHelper.prototyp
         if (this.isCachedObserver) {
             this.home.mObservers.notify("onLoad", [this.home]);
         } else {
             // start sync action after uncached calendar has been loaded.
             // xxx todo, think about:
             // although onAddItem et al have been called, we need to fire
             // an additional onLoad completing the refresh call (->composite)
             let home = this.home;
-            home.synchronize(function(status) {
+            home.synchronize((status) => {
                 home.mObservers.notify("onLoad", [home]);
             });
         }
     },
 
     onAddItem: function(aItem) {
         if (this.isCachedObserver) {
             this.home.mObservers.notify("onAddItem", arguments);
@@ -353,22 +353,22 @@ 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, function(item) {
+                    cal.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);
-                    }, function() {
+                    }, () => {
                         completeListener.getsCompleted++;
                         if (completeListener.opCompleted) {
                             // onOperationComplete was called, but we were not ready yet. call it now.
                             completeListener.onOperationComplete.apply(completeListener, completeListener.opCompleted);
                             completeListener.opCompleted = false;
                         }
                     });
                 }
@@ -378,17 +378,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.slice(arguments);
                     return;
                 }
 
                 if (Components.isSuccessCode(aStatus)) {
-                    cal.forEach(self.offlineCachedItems, function(item) {
+                    cal.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) {
@@ -420,23 +420,23 @@ calCachedCalendar.prototype = {
                                         // ...and has not been modified. Delete it now.
                                         self.deleteOfflineItem(item, null);
                                     }
                                 } else {
                                     // Item has already been deleted from the server, no need to change anything.
                                 }
                                 break;
                         }
-                    }, function() {
+                    }, () => {
                         self.offlineCachedItems = {};
                         self.offlineCachedItemFlags = {};
                         self.playbackOfflineItems(() => emptyQueue(aStatus));
                     });
                 } else {
-                    self.playbackOfflineItems(function() { self.mCachedObserver.onLoad(self.mCachedCalendar); });
+                    self.playbackOfflineItems(() => self.mCachedObserver.onLoad(self.mCachedCalendar));
                     emptyQueue(aStatus);
                 }
             }
         };
 
         this.getOfflineAddedItems(() => {
             this.mPendingSync = this.mUncachedCalendar.getItems(Components.interfaces.calICalendar.ITEM_FILTER_ALL_ITEMS,
                                                                     0, null, null, completeListener);
@@ -618,21 +618,19 @@ calCachedCalendar.prototype = {
         } else {
             this.downstreamRefresh();
         }
     },
     downstreamRefresh: function() {
         if (this.mUncachedCalendar.canRefresh && !this.offline) {
             return this.mUncachedCalendar.refresh(); // will trigger synchronize once the calendar is loaded
         } else {
-            let self = this;
-            return this.synchronize(
-                function(status) { // fire completing onLoad for this refresh call
-                    self.mCachedObserver.onLoad(self.mCachedCalendar);
-                });
+            return this.synchronize((status) => { // fire completing onLoad for this refresh call
+                this.mCachedObserver.onLoad(this.mCachedCalendar);
+            });
         }
     },
 
     addObserver: function(aObserver) {
         this.mObservers.add(aObserver);
     },
     removeObserver: function(aObserver) {
         this.mObservers.remove(aObserver);
--- a/calendar/base/src/calCalendarManager.js
+++ b/calendar/base/src/calCalendarManager.js
@@ -418,17 +418,17 @@ calCalendarManager.prototype = {
                             errorBoxButtonFlags,
                             errorBoxButtonLabel,
                             null, // No second button text
                             null, // No third button text
                             null, // No checkbox
                             { value: false }); // Unnecessary checkbox state
 
         // Disable Lightning
-        AddonManager.getAddonByID("{e2fda1a4-762b-4020-b5ad-a41df1933103}", function(aAddon) {
+        AddonManager.getAddonByID("{e2fda1a4-762b-4020-b5ad-a41df1933103}", (aAddon) => {
             aAddon.userDisabled = true;
             Services.startup.quit(Components.interfaces.nsIAppStartup.eRestart |
                 Components.interfaces.nsIAppStartup.eForceQuit);
         });
     },
 
     /**
      * calICalendarManager interface
--- a/calendar/base/src/calDefaultACLManager.js
+++ b/calendar/base/src/calDefaultACLManager.js
@@ -69,17 +69,17 @@ calDefaultCalendarACLEntry.prototype = {
 
     hasAccessControl: false,
     userIsOwner: true,
     userCanAddItems: true,
     userCanDeleteItems: true,
 
     _getIdentities: function(aCount) {
         let identities = [];
-        cal.calIterateEmailIdentities(function(id, ac) { identities.push(id); });
+        cal.calIterateEmailIdentities(id => identities.push(id));
         aCount.value = identities.length;
         return identities;
     },
 
     getUserAddresses: function(aCount) {
         let identities = this.getUserIdentities(aCount);
         let addresses = identities.map(id => id.email);
         return addresses;
--- a/calendar/base/src/calFilter.js
+++ b/calendar/base/src/calFilter.js
@@ -357,19 +357,17 @@ calFilter.prototype = {
         // TODO: Support specifying which fields to search on
         for (let field of ["SUMMARY", "DESCRIPTION", "LOCATION", "URL"]) {
             let val = aItem.getProperty(field);
             if (val && val.toLowerCase().includes(searchText)) {
                 return true;
             }
         }
 
-        return aItem.getCategories({}).some(function(cat) {
-            return cat.toLowerCase().includes(searchText);
-        });
+        return aItem.getCategories({}).some(cat => cat.toLowerCase().includes(searchText));
     },
 
     /**
      * Checks if the item matches the current filter date range.
      *
      * @param aItem               The item to check.
      * @return                    Returns true if the item falls within the date range
      *                            specified by mStartDate and mEndDate, false otherwise.
@@ -415,19 +413,17 @@ calFilter.prototype = {
         if (result && props.category) {
             let cats = [];
 
             if (typeof props.category == "string") {
                 cats.push(props.category);
             } else if (Array.isArray(props.category)) {
                 cats = props.category;
             }
-            result = cats.some(function(cat) {
-                return aItem.getCategories({}).includes(cat);
-            });
+            result = cats.some(cat => aItem.getCategories({}).includes(cat));
         }
 
         // test the status property. Only applies to tasks.
         if (result && props.status != null && cal.isToDo(aItem)) {
             let completed = aItem.isCompleted;
             let current = !aItem.completedDate || today.compare(aItem.completedDate) <= 0;
             let percent = aItem.percentComplete || 0;
 
--- a/calendar/base/src/calIcsParser.js
+++ b/calendar/base/src/calIcsParser.js
@@ -56,17 +56,17 @@ calIcsParser.prototype = {
             }
 
             for (let subComp of cal.ical.subcomponentIterator(calComp)) {
                 state.submit(subComp);
             }
             calComp = rootComp.getNextSubcomponent("VCALENDAR");
         }
 
-        state.join(function() {
+        state.join(() => {
             let fakedParents = {};
             // tag "exceptions", i.e. items with rid:
             for (let item of state.excItems) {
                 let parent = state.uid2parent[item.id];
 
                 if (!parent) { // a parentless one, fake a master and override it's occurrence
                     parent = isEvent(item) ? createEvent() : createTodo();
                     parent.id = item.id;
--- a/calendar/base/src/calItipItem.js
+++ b/calendar/base/src/calItipItem.js
@@ -111,21 +111,20 @@ calItipItem.prototype = {
             while (propEnum.hasMoreElements()) {
                 let prop = propEnum.getNext().QueryInterface(Components.interfaces.nsIProperty);
                 let pname = prop.name;
                 if (pname != "X-MOZ-FAKED-MASTER" && pname.substr(0, "X-MOZ-".length) == "X-MOZ-") {
                     item.deleteProperty(prop.name);
                 }
             }
             // never publish an organizer's RECEIVED params:
-            item.getAttendees({}).forEach(
-                function(att) {
-                    att.deleteProperty("RECEIVED-SEQUENCE");
-                    att.deleteProperty("RECEIVED-DTSTAMP");
-                });
+            item.getAttendees({}).forEach((att) => {
+                att.deleteProperty("RECEIVED-SEQUENCE");
+                att.deleteProperty("RECEIVED-DTSTAMP");
+            });
             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({}))) {
             cleanItem(item);
             // only push non-faked master items or
@@ -153,17 +152,17 @@ calItipItem.prototype = {
             }
         }
 
         this.mIsInitialized = true;
     },
 
     clone: function() {
         let newItem = new calItipItem();
-        newItem.mItemList = this.mItemList.map(function(item) { return item.clone(); });
+        newItem.mItemList = this.mItemList.map(item => item.clone());
         newItem.mReceivedMethod = this.mReceivedMethod;
         newItem.mResponseMethod = this.mResponseMethod;
         newItem.mAutoResponse = this.mAutoResponse;
         newItem.mTargetCalendar = this.mTargetCalendar;
         newItem.mIdentity = this.mIdentity;
         newItem.mLocalStatus = this.mLocalStatus;
         newItem.mIsSend = this.mIsSend;
         newItem.mIsInitialized = this.mIsInitialized;
--- a/calendar/base/src/calRecurrenceInfo.js
+++ b/calendar/base/src/calRecurrenceInfo.js
@@ -571,17 +571,17 @@ calRecurrenceInfo.prototype = {
             dates = dates.slice(0, aMaxCount);
         }
 
         return dates;
     },
 
     getOccurrenceDates: function(aRangeStart, aRangeEnd, aMaxCount, aCount) {
         let dates = this.calculateDates(aRangeStart, aRangeEnd, aMaxCount);
-        dates = dates.map(function(d) { return d.rstart; });
+        dates = dates.map(d => d.rstart);
         aCount.value = dates.length;
         return dates;
     },
 
     getOccurrences: function(aRangeStart, aRangeEnd, aMaxCount, aCount) {
         let results = [];
         let dates = this.calculateDates(aRangeStart, aRangeEnd, aMaxCount);
         if (dates.length) {
--- a/calendar/base/src/calTimezone.js
+++ b/calendar/base/src/calTimezone.js
@@ -44,17 +44,17 @@ calICALJSTimezone.prototype = {
         let bundle = ICAL.Timezone.cal_tz_bundle;
         let stringName = "pref.timezone." + this.tzid.replace(/\//g, ".");
         let displayName = this.tzid;
         try {
             displayName = bundle.GetStringFromName(stringName);
         } catch (e) {
             // Just use the TZID if the string is mising.
         }
-        this.__defineGetter__("displayName", function() {
+        this.__defineGetter__("displayName", () => {
             return displayName;
         });
         return displayName;
     },
 
     tostring: function() { return this.innerObject.toString(); }
 };
 
--- a/calendar/import-export/calHtmlExport.js
+++ b/calendar/import-export/calHtmlExport.js
@@ -40,17 +40,17 @@ calHtmlExporter.prototype = {
     },
 
     exportToStream: function(aStream, aCount, aItems, aTitle) {
         let document = cal.xml.parseFile("chrome://calendar-common/skin/printing/calHtmlExport.html");
         let itemContainer = document.getElementById("item-container");
         document.getElementById("title").textContent = aTitle || cal.calGetString("calendar", "HTMLTitle");
 
         // Sort aItems
-        aItems.sort(function(a, b) {
+        aItems.sort((a, b) => {
             let start_a = a[cal.calGetStartDateProp(a)];
             if (!start_a) {
                 return -1;
             }
             let start_b = b[cal.calGetStartDateProp(b)];
             if (!start_b) {
                 return 1;
             }
--- a/calendar/import-export/calOutlookCSVImportExport.js
+++ b/calendar/import-export/calOutlookCSVImportExport.js
@@ -442,19 +442,17 @@ calOutlookCSVExporter.prototype = {
         headers.push(localeEn.headAllDayEvent);
         headers.push(localeEn.headAlarm);
         headers.push(localeEn.headAlarmDate);
         headers.push(localeEn.headAlarmTime);
         headers.push(localeEn.headCategories);
         headers.push(localeEn.headDescription);
         headers.push(localeEn.headLocation);
         headers.push(localeEn.headPrivate);
-        headers = headers.map(function(v) {
-            return '"' + v + '"';
-        });
+        headers = headers.map(v => '"' + v + '"');
         str = headers.join(",");
         str += exportLineEnding;
         aStream.write(str, str.length);
 
         for (let item of aItems) {
             if (!cal.isEvent(item)) {
                 // XXX TODO: warn the user (once) that tasks are not supported
                 // (bug 336175)
@@ -475,17 +473,14 @@ calOutlookCSVExporter.prototype = {
             line.push(alarmDate ? localeEn.valueTrue : localeEn.valueFalse);
             line.push(alarmDate ? dateString(alarmDate) : "");
             line.push(alarmDate ? timeString(alarmDate) : "");
             line.push(txtString(cal.categoriesArrayToString(item.getCategories({})))); // xxx todo: what's the correct way to encode ',' in csv?, how are multi-values expressed?
             line.push(txtString(item.getProperty("DESCRIPTION")));
             line.push(txtString(item.getProperty("LOCATION")));
             line.push(item.privacy == "PRIVATE" ? localeEn.valueTrue : localeEn.valueFalse);
 
-            line = line.map(function(v) {
-                v = String(v).replace(/"/g, '""');
-                return '"' + v + '"';
-            });
+            line = line.map(v => `"${String(v).replace(/"/g, '""')}"`);
             str = line.join(",") + exportLineEnding;
             aStream.write(str, str.length);
         }
     }
 };
--- a/calendar/lightning/components/calItipProtocolHandler.js
+++ b/calendar/lightning/components/calItipProtocolHandler.js
@@ -114,20 +114,20 @@ ItipContentHandler.prototype = {
         if (!uri.startsWith(ITIP_HANDLER_PROTOCOL + ":")) {
             cal.ERROR("Unexpected iTIP uri: " + uri + "\n");
             throw NS_ERROR_WONT_HANDLE_CONTENT;
         }
         // moz-cal-handle-itip:///?
         let paramString = uri.substring(ITIP_HANDLER_PROTOCOL.length + 4);
         let paramArray = paramString.split("&");
         let paramBlock = { };
-        paramArray.forEach(function(v) {
+        paramArray.forEach((v) => {
             let parts = v.split("=");
             paramBlock[parts[0]] = unescape(unescape(parts[1]));
-            });
+        });
         // dump("content-handler: have params " + paramBlock.toSource() + "\n");
         let event = cal.createEvent(paramBlock.data);
         dump("Processing iTIP event '" + event.title + "' from " +
             event.organizer.id + " (" + event.id + ")\n");
         let calMgr = cal.getCalendarManager();
         let cals = calMgr.getCalendars({});
         cals[0].addItem(event, null);
     }
--- a/calendar/lightning/content/lightning-item-iframe.js
+++ b/calendar/lightning/content/lightning-item-iframe.js
@@ -2135,17 +2135,17 @@ function uploadCloudAttachment(attachmen
                 // delete it from the attach map now, this will make sure it is
                 // not serialized if the user saves.
                 listItem.setAttribute("image", "chrome://messenger/skin/icons/error.png");
                 delete gAttachMap[attachment.hashId];
 
                 // Keep the item for a while so the user can see something failed.
                 // When we have a nice notification bar, we can show more info
                 // about the failure.
-                setTimeout(function() {
+                setTimeout(() => {
                     listItem.remove();
                     updateAttachment();
                 }, 5000);
             }
         }
     });
 }
 
--- a/calendar/lightning/content/messenger-overlay-sidebar.js
+++ b/calendar/lightning/content/messenger-overlay-sidebar.js
@@ -344,17 +344,17 @@ var calendarItemTabType = {
                         aTabmail.openTab(aState.tabType, aState.args);
                     }
                 });
             }
         }
     }
 };
 
-window.addEventListener("load", function(e) {
+window.addEventListener("load", (e) => {
     let tabmail = document.getElementById("tabmail");
     tabmail.registerTabType(calendarTabType);
     tabmail.registerTabType(calendarItemTabType);
     tabmail.registerTabMonitor(calendarTabMonitor);
 }, false);
 
 
 function ltnOnLoad(event) {
@@ -523,17 +523,17 @@ function ltnIntegrationCheck() {
         if (cnt.value == 1 &&
             calMgr.getCalendarPref_(cals[0], "type") == "storage" &&
             calMgr.getCalendarPref_(cals[0], "name") == homeCalName) {
             // this looks like a default setup, so let's see whether the calendar contains any items
             let pCal = cal.async.promisifyCalendar(cals[0]);
             // we look at all items at any time, but we can stop if the first item was found
             // if we've found no items, we call ltnIntegrationNotification to display the bar
             pCal.getItems(Components.interfaces.calICalendar.ITEM_FILTER_ALL_ITEMS, 1, null, null)
-                .then(function(aItems) { if (!aItems.length) { ltnIntegrationNotification(); } });
+                .then((aItems) => { if (!aItems.length) { ltnIntegrationNotification(); } });
         }
     }
 }
 
 /* Called at midnight to tell us to redraw date-specific widgets.  Do NOT call
  * this for normal refresh, since it also calls scheduleMidnightRefresh.
  */
 function refreshUIBits() {
@@ -542,17 +542,17 @@ function refreshUIBits() {
 
         // Refresh the current view and just allow the refresh for the others
         // views when will be displayed.
         let currView = currentView();
         currView.goToDay();
         ["day-view",
          "week-view",
          "multiweek-view",
-         "month-view"].forEach(function(view) {
+         "month-view"].forEach((view) => {
             if (view != currView.id) {
                 document.getElementById(view).mToggleStatus = -1;
             }
         });
 
         if (!TodayPane.showsToday()) {
             TodayPane.setDay(now());
         }
--- a/calendar/lightning/content/suite-overlay-sidebar.js
+++ b/calendar/lightning/content/suite-overlay-sidebar.js
@@ -16,17 +16,17 @@ var ltnSuiteUtils = {
     observe: function(subject, topic, state) {
       if (topic != "lightning-startup-done" &&
           topic != "calendar-taskview-startup-done") {
         return;
       }
 
       [["CustomizeTaskActionsToolbar", "task-actions-toolbox"],
        ["CustomizeCalendarToolbar", "calendar-toolbox"],
-       ["CustomizeTaskToolbar", "task-toolbox"]].forEach(function(eIDs) {
+       ["CustomizeTaskToolbar", "task-toolbox"]].forEach((eIDs) => {
         let [itemID, toolboxID] = eIDs;
         let item = document.getElementById(itemID);
         let toolbox = document.getElementById(toolboxID);
         toolbox.customizeInit = function() {
           item.setAttribute("disabled", "true");
           toolboxCustomizeInit("mail-menubar");
         };
         toolbox.customizeDone = function(aToolboxChanged) {
--- a/calendar/providers/composite/calCompositeCalendar.js
+++ b/calendar/providers/composite/calCompositeCalendar.js
@@ -118,19 +118,17 @@ calCompositeCalendar.prototype = {
 
     mCalendars: null,
     mDefaultCalendar: null,
     mPrefPrefix: null,
     mDefaultPref: null,
     mActivePref: null,
 
     get enabledCalendars() {
-      return this.mCalendars.filter(
-        function(e) { return !e.getProperty("disabled"); }
-      );
+      return this.mCalendars.filter(e => !e.getProperty("disabled"));
     },
 
     set prefPrefix(aPrefPrefix) {
         if (this.mPrefPrefix) {
             for (let calendar of this.mCalendars) {
                 this.removeCalendar(calendar);
             }
         }
@@ -174,17 +172,17 @@ calCompositeCalendar.prototype = {
         // if we have no default calendar, we need one here
         if (this.mDefaultCalendar == null && !aCalendar.getProperty("disabled")) {
             this.setDefaultCalendar(aCalendar, false);
         }
     },
 
     removeCalendar: function(aCalendar) {
         let id = aCalendar.id;
-        let newCalendars = this.mCalendars.filter(function(calendar) { return calendar.id != id; });
+        let newCalendars = this.mCalendars.filter(calendar => calendar.id != id);
         if (newCalendars.length != this.mCalendars) {
             this.mCalendars = newCalendars;
             if (this.mPrefPrefix) {
                 aCalendar.deleteProperty(this.mActivePref);
                 aCalendar.deleteProperty(this.mDefaultPref);
             }
             aCalendar.removeObserver(this.mObserverHelper);
             this.mCompositeObservers.notify("onCalendarRemoved", [aCalendar]);
--- a/calendar/providers/ics/calICSCalendar.js
+++ b/calendar/providers/ics/calICSCalendar.js
@@ -438,21 +438,20 @@ calICSCalendar.prototype = {
             this.forceRefresh();
             ctxt.unlock(calIErrors.MODIFICATION_FAILED);
             Services.startup.exitLastWindowClosingSurvivalArea();
             return;
         }
 
         // Allow the hook to grab data of the channel, like the new etag
 
-        ctxt.mHooks.onAfterPut(request,
-                               function() {
-                                   ctxt.unlock();
-                                   Services.startup.exitLastWindowClosingSurvivalArea();
-                               });
+        ctxt.mHooks.onAfterPut(request, () => {
+            ctxt.unlock();
+            Services.startup.exitLastWindowClosingSurvivalArea();
+        });
     },
 
     // Always use the queue, just to reduce the amount of places where
     // this.mMemoryCalendar.addItem() and friends are called. less
     // copied code.
     addItem: function(aItem, aListener) {
         this.adoptItem(aItem.clone(), aListener);
     },
@@ -581,30 +580,29 @@ calICSCalendar.prototype = {
 
     lock: function() {
         this.locked = true;
     },
 
     unlock: function(errCode) {
         ASSERT(this.locked, "unexpected!");
 
-        this.mModificationActions.forEach(
-            function(action) {
-                let args = action.opCompleteArgs;
-                ASSERT(args, "missing onOperationComplete call!");
-                let listener = action.listener;
-                if (listener) {
-                    if (Components.isSuccessCode(args[1]) &&
-                        errCode && !Components.isSuccessCode(errCode)) {
-                        listener.onOperationComplete(args[0], errCode, args[2], args[3], null);
-                    } else {
-                        listener.onOperationComplete.apply(listener, args);
-                    }
+        this.mModificationActions.forEach((action) => {
+            let args = action.opCompleteArgs;
+            ASSERT(args, "missing onOperationComplete call!");
+            let listener = action.listener;
+            if (listener) {
+                if (Components.isSuccessCode(args[1]) &&
+                    errCode && !Components.isSuccessCode(errCode)) {
+                    listener.onOperationComplete(args[0], errCode, args[2], args[3], null);
+                } else {
+                    listener.onOperationComplete.apply(listener, args);
                 }
-            });
+            }
+        });
         this.mModificationActions = [];
 
         this.locked = false;
         this.processQueue();
     },
 
     isLocked: function() {
         return this.locked;
--- a/calendar/providers/wcap/calWcapCalendar.js
+++ b/calendar/providers/wcap/calWcapCalendar.js
@@ -213,17 +213,17 @@ calWcapCalendar.prototype = {
     issueNetworkRequest: function(
               request, respFunc, dataConvFunc, wcapCommand, params, accessRights) {
         let self = this;
         // - bootstrap problem: no cal_props, no access check, no default calId
         // - assure being logged in, thus the default cal_props are available
         // - every subscribed calendar will come along with cal_props
         return this.session.getSessionId(
             request,
-            function(err, sessionId) {
+            (err, sessionId) => {
                 try {
                     if (err) {
                         throw err;
                     }
                     self.assureAccess(accessRights);
                     params += ("&calid=" + encodeURIComponent(self.calId));
                     self.session.issueNetworkRequest(request, respFunc, dataConvFunc, wcapCommand, params);
                 } catch (exc) {
--- a/calendar/providers/wcap/calWcapCalendarItems.js
+++ b/calendar/providers/wcap/calWcapCalendarItems.js
@@ -269,59 +269,60 @@ var METHOD_REPLY = 4;
 var METHOD_CANCEL = 8;
 var METHOD_UPDATE = 256;
 /* eslint-enable no-unused-vars */
 
 calWcapCalendar.prototype.storeItem = function(bAddItem, item, oldItem, request) {
     function getOrgId(orgItem) {
         return (orgItem && orgItem.organizer && orgItem.organizer.id ? orgItem.organizer.id : null);
     }
-    function encodeAttendees(atts) {
+    function encodeCategories(cats) {
+        cats = cats.concat([]);
+        cats.sort();
+        return cats.join(";");
+    }
+    function getPrivacy(pitem) {
+        return ((pitem.privacy && pitem.privacy != "") ? pitem.privacy : "PUBLIC");
+    }
+
+    let encodeAttendees = (atts) => {
         function attendeeSort(one, two) {
             one = one.id;
             two = two.id;
             if (one == two) {
                 return 0;
             }
             return (one < two ? -1 : 1);
         }
         atts = atts.concat([]);
         atts.sort(attendeeSort);
-        return atts.map(self.encodeAttendee, self).join(";");
-    }
-    function encodeCategories(cats) {
-        cats = cats.concat([]);
-        cats.sort();
-        return cats.join(";");
-    }
-    function getPrivacy(pitem) {
-        return ((pitem.privacy && pitem.privacy != "") ? pitem.privacy : "PUBLIC");
-    }
-    function getAttachments(attitem) {
+        return atts.map(this.encodeAttendee, this).join(";");
+    };
+
+    let getAttachments = (attitem) => {
         let ret;
         let attachments = attitem.attachments;
         if (attachments) {
             let strings = [];
             for (let att of attachments) {
                 let wrappedAtt = cal.wrapInstance(att, Components.interfaces.calIAttachment);
                 if (typeof att == "string") {
                     strings.push(encodeURIComponent(att));
                 } else if (wrappedAtt && wrappedAtt.uri) {
                     strings.push(encodeURIComponent(wrappedAtt.uri.spec));
                 } else { // xxx todo
-                    logError("only URLs supported as attachment, not: " + att, self);
+                    logError("only URLs supported as attachment, not: " + att, this);
                 }
             }
             strings.sort();
             ret = strings.join(";");
         }
         return ret || "";
-    }
+    };
 
-    let self = this;
     let bIsEvent = isEvent(item);
     let bIsParent = isParent(item);
 
     let method = METHOD_PUBLISH;
     let bNoSmtpNotify = false;
     let params = "";
 
     let calId = this.calId;
@@ -619,26 +620,25 @@ calWcapCalendar.prototype.tunnelXProps =
             }
         } catch (exc) {
             logError(exc, this);
         }
     }
 };
 
 calWcapCalendar.prototype.adoptItem = function(item, listener) {
-    let self = this;
     let request = new calWcapRequest(
-        function(oprequest, err, newItem) {
-            self.notifyOperationComplete(listener,
+        (oprequest, err, newItem) => {
+            this.notifyOperationComplete(listener,
                                          getResultCode(err),
                                          calIOperationListener.ADD,
                                          err ? item.id : newItem.id,
                                          err ? err : newItem);
-            if (!err && self == self.superCalendar) {
-                self.notifyObservers("onAddItem", [newItem]);
+            if (!err && this == this.superCalendar) {
+                this.notifyObservers("onAddItem", [newItem]);
             }
         },
         log("adoptItem() call: " + item.title, this));
 
     try {
         this.storeItem(true /* bAddItem */, item, null, request);
     } catch (exc) {
         request.execRespFunc(exc);
@@ -646,25 +646,24 @@ calWcapCalendar.prototype.adoptItem = fu
     return request;
 };
 
 calWcapCalendar.prototype.addItem = function(item, listener) {
     this.adoptItem(item.clone(), listener);
 };
 
 calWcapCalendar.prototype.modifyItem = function(newItem, oldItem, listener) {
-    let self = this;
     let request = new calWcapRequest(
-        function(oprequest, err, item) {
-            self.notifyOperationComplete(listener,
+        (oprequest, err, item) => {
+            this.notifyOperationComplete(listener,
                                          getResultCode(err),
                                          calIOperationListener.MODIFY,
                                          newItem.id, err ? err : item);
-            if (!err && self == self.superCalendar) {
-                self.notifyObservers("onModifyItem", [item, oldItem]);
+            if (!err && this == this.superCalendar) {
+                this.notifyObservers("onModifyItem", [item, oldItem]);
             }
         },
         log("modifyItem() call: " + newItem.id, this));
 
     try {
         if (!newItem.id) {
             throw new Components.Exception("new item has no id!");
         }
@@ -673,18 +672,17 @@ calWcapCalendar.prototype.modifyItem = f
             // Due to a cs bug, EXDATEs cannot be passed with store, thus make a two-step delete then store.
             // First check if EXDATEs are passed or have been modified:
             let exdates = {};
             this.getRecurrenceParams(newItem, {}, {}, {}, exdates);
             if (oldItem) {
                 let exdates_ = {};
                 this.getRecurrenceParams(oldItem_, {}, {}, {}, exdates_);
                 // only use added elements
-                exdates.value = exdates.value.filter(
-                    function(elem) { return !exdates_.value.some(function(elem_) { return elem_ == elem; }); });
+                exdates.value = exdates.value.filter(elem => !exdates_.value.some(elem_ => elem_ == elem));
             } // else in case no oldItem is passed, nevertheless try to delete the EXDATEs
             if (exdates.value.length > 0) {
                 let params = "&uid=";
                 // all deletes on the same item:
                 for (let i = exdates.value.length; i--;) {
                     params += encodeURIComponent(newItem.id);
                     if (i > 0) {
                         params += ";";
@@ -696,26 +694,26 @@ calWcapCalendar.prototype.modifyItem = f
                 if (!orgCalId || (orgCalId != this.calId)) {
                     // item does not belong to this user, so don't notify:
                     params += "&smtp=0&smtpNotify=0&notify=0";
                 }
                 params += "&fmt-out=text%2Fxml";
 
                 request.lockPending();
                 this.issueNetworkRequest(request,
-                                         function(err, xml) {
+                                         (err, xml) => {
                                              try {
                                                  // ignore any error and continue storing the item:
                                                  if (LOG_LEVEL > 0) {
                                                      log("modifyItem EXDATEs: " +
-                                                         (xml ? getWcapRequestStatusString(xml) : "failed!"), self);
+                                                         (xml ? getWcapRequestStatusString(xml) : "failed!"), this);
                                                  }
                                                  // invalidate cached results:
-                                                 delete self.m_cachedResults;
-                                                 self.storeItem(false /* bAddItem */, newItem, oldItem_, request);
+                                                 delete this.m_cachedResults;
+                                                 this.storeItem(false /* bAddItem */, newItem, oldItem_, request);
                                              } finally {
                                                  request.unlockPending();
                                              }
                                          },
                                          stringToXml, isEvent(newItem) ? "deleteevents_by_id" : "deletetodos_by_id",
                                          params, calIWcapCalendar.AC_COMP_WRITE);
                 return request;
             }
@@ -726,26 +724,25 @@ calWcapCalendar.prototype.modifyItem = f
         this.storeItem(false /* bAddItem */, newItem, oldItem_, request);
     } catch (exc) {
         request.execRespFunc(exc);
     }
     return request;
 };
 
 calWcapCalendar.prototype.deleteItem = function(item, listener) {
-    let self = this;
     let request = new calWcapRequest(
-        function(oprequest, err) {
+        (oprequest, err) => {
             // xxx todo: need to notify about each deleted item if multiple?
-            self.notifyOperationComplete(listener,
+            this.notifyOperationComplete(listener,
                                          getResultCode(err),
                                          calIOperationListener.DELETE,
                                          item.id, err ? err : item);
-            if (!err && self == self.superCalendar) {
-                self.notifyObservers("onDeleteItem", [item]);
+            if (!err && this == this.superCalendar) {
+                this.notifyObservers("onDeleteItem", [item]);
             }
         },
         log("deleteItem() call: " + item.id, this));
 
     try {
         if (!item.id) {
             throw new Components.Exception("no item id!");
         }
@@ -761,24 +758,24 @@ calWcapCalendar.prototype.deleteItem = f
         if (!orgCalId || (orgCalId != this.calId)) {
             // item does not belong to this user, so don't notify:
             params += "&smtp=0&smtpNotify=0&notify=0";
         }
 
         params += "&fmt-out=text%2Fxml";
 
         this.issueNetworkRequest(request,
-                                 function(err, xml) {
+                                 (err, xml) => {
                                      if (err) {
                                          throw err;
                                      }
                                      // invalidate cached results:
-                                     delete self.m_cachedResults;
+                                     delete this.m_cachedResults;
                                      if (LOG_LEVEL > 0) {
-                                         log("deleteItem(): " + getWcapRequestStatusString(xml), self);
+                                         log("deleteItem(): " + getWcapRequestStatusString(xml), this);
                                      }
                                  },
                                  stringToXml, isEvent(item) ? "deleteevents_by_id" : "deletetodos_by_id",
                                  params, calIWcapCalendar.AC_COMP_WRITE);
     } catch (exc) {
         request.execRespFunc(exc);
     }
     return request;
@@ -1016,25 +1013,24 @@ calWcapCalendar.prototype.parseItems = f
 
     if (LOG_LEVEL > 1) {
         log("parseItems(): returning " + items.length + " items", this);
     }
     return items;
 };
 
 calWcapCalendar.prototype.getItem = function(id, listener) {
-    let self = this;
     let request = new calWcapRequest(
-        function(oprequest, err, item) {
+        (oprequest, err, item) => {
             if (checkErrorCode(err, calIWcapErrors.WCAP_FETCH_EVENTS_BY_ID_FAILED) ||
                 checkErrorCode(err, calIWcapErrors.WCAP_COMPONENT_NOT_FOUND)) {
                 // querying by id is a valid use case, even if no item is returned:
                 err = NS_OK;
             }
-            self.notifyOperationComplete(listener,
+            this.notifyOperationComplete(listener,
                                          getResultCode(err),
                                          calIOperationListener.GET,
                                          item ? item.id : null,
                                          err || item);
         },
         log("getItem() call: id=" + id, this));
 
     try {
@@ -1043,42 +1039,42 @@ calWcapCalendar.prototype.getItem = func
         }
         let params = "&relativealarm=1&compressed=1&recurring=1";
         params += "&emailorcalid=1&fmt-out=text%2Fcalendar&uid=";
         params += encodeURIComponent(id);
 
         // most common: try events first
         this.issueNetworkRequest(
             request,
-            function(err, eventRootComp) {
-                function notifyResult(rootComp) {
-                    let items = self.parseItems(rootComp, calICalendar.ITEM_FILTER_ALL_ITEMS, 0, null, null);
+            (err, eventRootComp) => {
+                let notifyResult = (rootComp) => {
+                    let items = this.parseItems(rootComp, calICalendar.ITEM_FILTER_ALL_ITEMS, 0, null, null);
                     if (items.length < 1) {
                         throw new Components.Exception("no such item!");
                     }
                     if (items.length > 1) {
-                        self.notifyError(NS_ERROR_UNEXPECTED,
+                        this.notifyError(NS_ERROR_UNEXPECTED,
                                          "unexpected number of items: " + items.length);
                     }
                     if (listener) {
-                        listener.onGetResult(self.superCalendar, NS_OK,
-                                             calIItemBase, log("getItem(): success. id=" + id, self),
+                        listener.onGetResult(this.superCalendar, NS_OK,
+                                             calIItemBase, log("getItem(): success. id=" + id, this),
                                              items.length, items);
                     }
                     request.execRespFunc(null, items[0]);
-                }
+                };
                 if (err) {
                     if (!checkErrorCode(err, calIWcapErrors.WCAP_FETCH_EVENTS_BY_ID_FAILED) &&
                         !checkErrorCode(err, calIWcapErrors.WCAP_COMPONENT_NOT_FOUND)) {
                         throw err;
                     }
                     // try todos:
-                    self.issueNetworkRequest(
+                    this.issueNetworkRequest(
                         request,
-                        function(fetcherr, todoRootComp) {
+                        (fetcherr, todoRootComp) => {
                             if (fetcherr) {
                                 throw fetcherr;
                             }
                             notifyResult(todoRootComp);
                         },
                         stringToIcal, "fetchtodos_by_id", params, calIWcapCalendar.AC_COMP_READ);
                 } else {
                     notifyResult(eventRootComp);
@@ -1126,21 +1122,20 @@ function getItemFilterParams(itemFilter)
 }
 
 calWcapCalendar.prototype.getItems = function(itemFilter, maxResults, rangeStart, rangeEnd, listener) {
     rangeStart = ensureDateTime(rangeStart);
     rangeEnd = ensureDateTime(rangeEnd);
     let zRangeStart = getIcalUTC(rangeStart);
     let zRangeEnd = getIcalUTC(rangeEnd);
 
-    let self = this;
     let request = new calWcapRequest(
-        function(oprequest, err, data) {
-            log("getItems() complete: " + errorToString(err), self);
-            self.notifyOperationComplete(listener,
+        (oprequest, err, data) => {
+            log("getItems() complete: " + errorToString(err), this);
+            this.notifyOperationComplete(listener,
                                          getResultCode(err),
                                          calIOperationListener.GET,
                                          null,
                                          err);
         },
         log("getItems():\n\titemFilter=0x" + itemFilter.toString(0x10) +
             ",\n\tmaxResults=" + maxResults +
             ",\n\trangeStart=" + zRangeStart +
@@ -1184,136 +1179,135 @@ calWcapCalendar.prototype.getItems = fun
         if (maxResults > 0) {
             params += "&maxResults=" + maxResults;
         }
         params += "&dtstart=" + zRangeStart;
         params += "&dtend=" + zRangeEnd;
 
         this.issueNetworkRequest(
             request,
-            function(err, icalRootComp) {
+            (err, icalRootComp) => {
                 if (err) {
                     if (checkErrorCode(err, calIWcapErrors.WCAP_ACCESS_DENIED_TO_CALENDAR)) {
                         // try free-busy times:
                         if (listener &&
                             (itemFilter & calICalendar.ITEM_FILTER_TYPE_EVENT) &&
                             rangeStart && rangeEnd) {
                             let freeBusyListener = { // calIGenericOperationListener:
                                 onResult: function(oprequest, result) {
                                     if (!Components.isSuccessCode(oprequest.status)) {
                                         throw oprequest.status;
                                     }
                                     let items = [];
                                     for (let entry of result) {
                                         let item = createEvent();
                                         item.id = g_busyPhantomItemUuidPrefix + getIcalUTC(entry.interval.start);
-                                        item.calendar = self.superCalendar;
+                                        item.calendar = this.superCalendar;
                                         item.title = g_busyItemTitle;
                                         item.startDate = entry.interval.start;
                                         item.endDate = entry.interval.end;
                                         item.makeImmutable();
                                         items.push(item);
                                     }
-                                    listener.onGetResult(self.superCalendar, NS_OK, calIItemBase,
+                                    listener.onGetResult(this.superCalendar, NS_OK, calIItemBase,
                                                          "getItems()/free-busy", items.length, items);
-                                }
+                                }.bind(this)
                             };
                             request.attachSubRequest(
-                                self.session.getFreeBusyIntervals(
-                                    self.calId, rangeStart, rangeEnd, calIFreeBusyInterval.BUSY_ALL,
+                                this.session.getFreeBusyIntervals(
+                                    this.calId, rangeStart, rangeEnd, calIFreeBusyInterval.BUSY_ALL,
                                     freeBusyListener));
                         }
                     } else {
                         throw err;
                     }
                 } else if (listener) {
-                    let items = self.parseItems(
+                    let items = this.parseItems(
                         icalRootComp, itemFilter, maxResults,
                         rangeStart, rangeEnd);
 
                     if (CACHE_LAST_RESULTS > 0) {
                         // auto invalidate after X minutes:
-                        if (!self.m_cachedResultsTimer) {
+                        if (!this.m_cachedResultsTimer) {
                             let callback = {
                                 notify: function(timer) {
-                                    if (!self.m_cachedResults) {
+                                    if (!this.m_cachedResults) {
                                         return;
                                     }
                                     let now = (new Date()).getTime();
                                     // sort out old entries:
                                     let entries = [];
-                                    for (let i = 0; i < self.m_cachedResults.length; ++i) {
-                                        let entry = self.m_cachedResults[i];
+                                    for (let i = 0; i < this.m_cachedResults.length; ++i) {
+                                        let entry = this.m_cachedResults[i];
                                         if ((now - entry.stamp) < (CACHE_LAST_RESULTS_INVALIDATE * 1000)) {
                                             entries.push(entry);
                                         } else {
                                             log("invalidating cached entry:\n\trangeStart=" +
                                                 getIcalUTC(entry.rangeStart) + "\n\trangeEnd=" +
-                                                getIcalUTC(entry.rangeEnd), self);
+                                                getIcalUTC(entry.rangeEnd), this);
                                         }
                                     }
-                                    self.m_cachedResults = entries;
-                                }
+                                    this.m_cachedResults = entries;
+                                }.bind(this)
                             };
                             // sort out freq:
                             let freq = Math.min(20, // default: 20secs
                                                 Math.max(1, CACHE_LAST_RESULTS_INVALIDATE));
-                            log("cached results sort out timer freq: " + freq, self);
-                            self.m_cachedResultsTimer = Components.classes["@mozilla.org/timer;1"]
+                            log("cached results sort out timer freq: " + freq, this);
+                            this.m_cachedResultsTimer = Components.classes["@mozilla.org/timer;1"]
                                                                   .createInstance(Components.interfaces.nsITimer);
-                            self.m_cachedResultsTimer.initWithCallback(callback, freq * 1000,
+                            this.m_cachedResultsTimer.initWithCallback(callback, freq * 1000,
                                                                        Components.interfaces.nsITimer.TYPE_REPEATING_SLACK);
                         }
-                        if (!self.m_cachedResults) {
-                            self.m_cachedResults = [];
+                        if (!this.m_cachedResults) {
+                            this.m_cachedResults = [];
                         }
                         let cacheEntry = {
                             stamp: (new Date()).getTime(),
                             itemFilter: itemFilter,
                             rangeStart: (rangeStart ? rangeStart.clone() : null),
                             rangeEnd: (rangeEnd ? rangeEnd.clone() : null),
                             results: items
                         };
-                        self.m_cachedResults.unshift(cacheEntry);
-                        if (self.m_cachedResults.length > CACHE_LAST_RESULTS) {
-                            self.m_cachedResults.length = CACHE_LAST_RESULTS;
+                        this.m_cachedResults.unshift(cacheEntry);
+                        if (this.m_cachedResults.length > CACHE_LAST_RESULTS) {
+                            this.m_cachedResults.length = CACHE_LAST_RESULTS;
                         }
                     }
 
-                    listener.onGetResult(self.superCalendar, NS_OK, calIItemBase, "getItems()", items.length, items);
+                    listener.onGetResult(this.superCalendar, NS_OK, calIItemBase, "getItems()", items.length, items);
                 }
             },
             stringToIcal, "fetchcomponents_by_range", params, calIWcapCalendar.AC_COMP_READ);
     } catch (exc) {
         request.execRespFunc(exc);
     }
     return request;
 };
 
 calWcapCalendar.prototype.offlineStorage = null;
 
 calWcapCalendar.prototype.resetLog = function() {
     this.deleteProperty("replay.last_stamp");
 };
 
 calWcapCalendar.prototype.replayChangesOn = function(listener) {
-    let self = this;
     let itemFilter = calICalendar.ITEM_FILTER_ALL_ITEMS;
     let dtFrom = getDatetimeFromIcalString(this.getProperty("replay.last_stamp"));
     let now = getTime(); // new stamp for this sync
 
     let request_ = new calWcapRequest(
-        function(request, err) {
+        (request, err) => {
             if (err) {
                 logError("error replaying changes: " + errorToString(err));
-                self.notifyError(err);
+                this.notifyError(err);
             } else {
-                log("replay succeeded.", self);
-                self.setProperty("replay.last_stamp", getIcalUTC(now));
-                log("new replay stamp: " + getIcalUTC(now), self);
+                log("replay succeeded.", this);
+                this.setProperty("replay.last_stamp", getIcalUTC(now));
+                log("new replay stamp: " + getIcalUTC(now), this);
             }
             if (listener) {
                 listener.onResult(request, null);
             }
         },
         log("replayChangesOn():\n\titemFilter=0x" + itemFilter.toString(0x10) +
             "\n\tdtFrom=" + getIcalUTC(dtFrom), this));
 
@@ -1323,95 +1317,95 @@ calWcapCalendar.prototype.replayChangesO
             onGetResult: function() {},
             onOperationComplete: function(aCalendar, status, opType, id, detail) {
                 if (!Components.isSuccessCode(status)) {
                     request.execRespFunc(status); // any error on writing breaks whole operation
                 }
             }
         };
         let request = new calWcapRequest(
-            function(err, data) {
+            (err, data) => {
                 let modifiedIds = {};
                 for (let item of request.m_modifiedItems) {
                     let dtCreated = item.getProperty("CREATED");
                     let bAdd = !dtCreated || !dtFrom || dtCreated.compare(dtFrom) >= 0;
                     modifiedIds[item.id] = true;
                     if (bAdd) {
-                        log("replayChangesOn(): new item " + item.id, self);
-                        if (self.offlineStorage) {
-                            self.offlineStorage.addItem(item, writeListener);
+                        log("replayChangesOn(): new item " + item.id, this);
+                        if (this.offlineStorage) {
+                            this.offlineStorage.addItem(item, writeListener);
                         }
                     } else {
-                        log("replayChangesOn(): modified item " + item.id, self);
-                        if (self.offlineStorage) {
-                            self.modifyItem(item, null, writeListener);
+                        log("replayChangesOn(): modified item " + item.id, this);
+                        if (this.offlineStorage) {
+                            this.modifyItem(item, null, writeListener);
                         }
                     }
                 }
                 for (let item of request.m_deletedItems) {
                     // don't delete anything that has been touched by lastmods:
                     if (modifiedIds[item.id]) {
-                        log("replayChangesOn(): skipping deletion of " + item.id, self);
+                        log("replayChangesOn(): skipping deletion of " + item.id, this);
                     } else if (isParent(item)) {
-                        log("replayChangesOn(): deleted item " + item.id, self);
-                        if (self.offlineStorage) {
-                            self.offlineStorage.deleteItem(item, writeListener);
+                        log("replayChangesOn(): deleted item " + item.id, this);
+                        if (this.offlineStorage) {
+                            this.offlineStorage.deleteItem(item, writeListener);
                         }
                     } else { // modify parent instead of
                              // straight-forward deleteItem(). WTF.
                         let parent = item.parentItem.clone();
                         parent.recurrenceInfo.removeOccurrenceAt(item.recurrenceId);
-                        log("replayChangesOn(): modified parent " + parent.id, self);
-                        if (self.offlineStorage) {
-                            self.offlineStorage.modifyItem(parent, item, writeListener);
+                        log("replayChangesOn(): modified parent " + parent.id, this);
+                        if (this.offlineStorage) {
+                            this.offlineStorage.modifyItem(parent, item, writeListener);
                         }
                     }
                 }
             }, "replayChangesOn() netFinishedRespFunc");
         request_.attachSubRequest(request);
 
         // assure being logged in to calc server times:
         this.session.getSessionId(
             request,
-            function(err, sessionId) {
+            (err, sessionId) => {
                 try {
                     if (err) {
                         throw err;
                     }
                     let params = "&relativealarm=1&compressed=1&recurring=1" +
                                  "&emailorcalid=1&fmt-out=text%2Fcalendar";
                     if (dtFrom) {
-                        dtFrom = self.session.getServerTime(dtFrom);
+                        dtFrom = this.session.getServerTime(dtFrom);
                     }
                     params += "&dtstart=" + getIcalUTC(dtFrom);
-                    params += "&dtend=" + getIcalUTC(self.session.getServerTime(now));
+                    params += "&dtend=" + getIcalUTC(this.session.getServerTime(now));
 
-                    log("replayChangesOn(): getting last modifications...", self);
-                    self.issueNetworkRequest(
+                    log("replayChangesOn(): getting last modifications...", this);
+                    this.issueNetworkRequest(
                         request,
-                        function(fetcherr, icalRootComp) {
+                        (fetcherr, icalRootComp) => {
                             if (fetcherr) {
                                 throw fetcherr;
                             }
-                            request.m_modifiedItems = self.parseItems(icalRootComp,
+                            request.m_modifiedItems = this.parseItems(icalRootComp,
                                                                       calICalendar.ITEM_FILTER_ALL_ITEMS,
                                                                       0, null, null);
                         },
                         stringToIcal, "fetchcomponents_by_lastmod",
                         params + getItemFilterParams(itemFilter),
                         calIWcapCalendar.AC_COMP_READ);
 
-                    log("replayChangesOn(): getting deleted items...", self);
-                    self.issueNetworkRequest(
+                    log("replayChangesOn(): getting deleted items...", this);
+                    this.issueNetworkRequest(
                         request,
-                        function(fetcherr, icalRootComp) {
+                        (fetcherr, icalRootComp) => {
                             if (fetcherr) {
                                 throw fetcherr;
                             }
-                            request.m_deletedItems = self.parseItems(icalRootComp,
+                            request.m_deletedItems = this.parseItems(icalRootComp,
                                                                      calICalendar.ITEM_FILTER_ALL_ITEMS,
                                                                      0, null, null);
                         },
                         stringToIcal, "fetch_deletedcomponents",
                         params + getItemFilterParams(itemFilter & // only component types
                                                      calICalendar.ITEM_FILTER_TYPE_ALL),
                         calIWcapCalendar.AC_COMP_READ);
                 } catch (exc) {
--- a/calendar/providers/wcap/calWcapRequest.js
+++ b/calendar/providers/wcap/calWcapRequest.js
@@ -90,45 +90,45 @@ calWcapRequest.prototype = {
         }
         ret += ", isPending=" + this.isPending;
         ret += ", status=" + errorToString(this.status);
         return ret;
     },
 
     attachSubRequest: function(req) {
         if (req) {
-            if (!this.m_attachedRequests.some(function(req_) { return req.id == req_.id; })) {
+            if (!this.m_attachedRequests.some(req_ => req.id == req_.id)) {
                 if (req.isPending) {
                     this.m_attachedRequests.push(req);
                     req.parentRequest = this;
                     log("attachSubRequest()", this);
                 } else if (!this.m_locked && this.m_attachedRequests.length == 0) {
                     this.execRespFunc(req.status);
                 }
             } else {
                 logError("request already attached: " + req.id, this);
             }
         }
     },
 
     detachSubRequest: function(req, err) {
-        this.m_attachedRequests = this.m_attachedRequests.filter(function(req_) { return req.id != req_.id; });
+        this.m_attachedRequests = this.m_attachedRequests.filter(req_ => req.id != req_.id);
         if (err) {
             // first failing sub request stops parent request:
             this.execRespFunc(err);
         } else if (!this.m_locked && this.m_attachedRequests.length == 0) {
             // assures that respFunc is executed after all sub requests have been completed:
             this.execRespFunc();
         }
     },
 
     cancelAllSubRequests: function(status) {
         let attachedRequests = this.m_attachedRequests;
         this.m_attachedRequests = [];
-        attachedRequests.forEach(function(req) { req.cancel(null); });
+        attachedRequests.forEach(req => req.cancel(null));
     },
 
     detachFromParent: function(err) {
         let parentRequest = this.m_parentRequest;
         if (parentRequest) {
             this.m_parentRequest = null;
             parentRequest.detachSubRequest(this, err);
         }
--- a/calendar/providers/wcap/calWcapSession.js
+++ b/calendar/providers/wcap/calWcapSession.js
@@ -187,18 +187,17 @@ calWcapSession.prototype = {
         ret.addDuration(this.m_serverTimeDiff);
         return ret;
     },
 
     m_sessionId: null,
     m_loginQueue: null,
     m_loginLock: false,
 
-    getSessionId:
-    function(request, respFunc, timedOutSessionId) {
+    getSessionId: function(request, respFunc, timedOutSessionId) {
         if (Services.io.offline) {
             log("in offline mode.", this);
             respFunc(new Components.Exception(errorToString(NS_ERROR_OFFLINE), NS_ERROR_OFFLINE));
             return;
         }
 
         log("login queue lock: " + this.m_loginLock + ", length: " + this.m_loginQueue.length, this);
 
@@ -216,175 +215,167 @@ calWcapSession.prototype = {
             this.m_sessionId = null; // invalidate for relogin
 
             if (timedOutSessionId) {
                 log("reconnecting due to session timeout...", this);
                 getFreeBusyService().removeProvider(this);
                 getCalendarSearchService().removeProvider(this);
             }
 
-            let self = this;
             this.getSessionId_(null, // don't couple to parent request parent may be cancelled
-                               function(err, sessionId) {
-                                   log("getSessionId_resp_(): " + sessionId, self);
+                               (err, sessionId) => {
+                                   log("getSessionId_resp_(): " + sessionId, this);
                                    if (!err) {
-                                       self.m_sessionId = sessionId;
-                                       getFreeBusyService().addProvider(self);
-                                       getCalendarSearchService().addProvider(self);
+                                       this.m_sessionId = sessionId;
+                                       getFreeBusyService().addProvider(this);
+                                       getCalendarSearchService().addProvider(this);
                                    }
 
-                                   let queue = self.m_loginQueue;
-                                   self.m_loginLock = false;
-                                   self.m_loginQueue = [];
-                                   log("unlocked login queue.", self);
+                                   let queue = this.m_loginQueue;
+                                   this.m_loginLock = false;
+                                   this.m_loginQueue = [];
+                                   log("unlocked login queue.", this);
 
-                                   function getSessionId_exec(func) {
+                                   let getSessionId_exec = (func) => {
                                        try {
                                            func(err, sessionId);
                                        } catch (exc) { // unexpected
-                                           self.notifyError(exc);
+                                           this.notifyError(exc);
                                        }
-                                   }
+                                   };
                                    // answer first request:
                                    getSessionId_exec(respFunc);
                                    // and any remaining:
                                    queue.forEach(getSessionId_exec);
                                });
         }
     },
 
     // this is a server limit for recurrencies; default is 60
     recurrenceBound: 60,
 
     getSessionId_: function(request, respFunc) {
-        let self = this;
         this.checkServerVersion(
             request,
             // probe whether server is accessible and responds:
-            function(err) {
+            (err) => {
                 if (err) {
                     respFunc(err);
                     return;
                 }
                 // lookup password manager, then try login or prompt/login:
-                log("attempting to get a session id for " + self.sessionUri.spec, self);
+                log("attempting to get a session id for " + this.sessionUri.spec, this);
 
-                if (!self.sessionUri.schemeIs("https") &&
-                    !confirmInsecureLogin(self.sessionUri)) {
-                    log("user rejected insecure login on " + self.sessionUri.spec, self);
+                if (!this.sessionUri.schemeIs("https") &&
+                    !confirmInsecureLogin(this.sessionUri)) {
+                    log("user rejected insecure login on " + this.sessionUri.spec, this);
                     respFunc(new Components.Exception(errorToString(calIWcapErrors.WCAP_LOGIN_FAILED),
                                                       calIWcapErrors.WCAP_LOGIN_FAILED));
                     return;
                 }
 
-                let outUser = { value: self.credentials.userId };
-                let outPW = { value: self.credentials.pw };
+                let outUser = { value: this.credentials.userId };
+                let outPW = { value: this.credentials.pw };
                 let outSavePW = { value: false };
 
                 if (outUser.value && !outPW.value) { // lookup pw manager
-                    log("looking in pw db for: " + self.uri.spec, self);
-                    cal.auth.passwordManagerGet(outUser.value, outPW, self.uri.spec, "wcap login");
+                    log("looking in pw db for: " + this.uri.spec, this);
+                    cal.auth.passwordManagerGet(outUser.value, outPW, this.uri.spec, "wcap login");
                 }
 
-                function promptAndLoginLoop_resp(loginerr, sessionId) {
+                let promptAndLoginLoop_resp = (loginerr, sessionId) => {
                     if (checkErrorCode(loginerr, calIWcapErrors.WCAP_LOGIN_FAILED)) {
-                        log("prompting for [user/]pw...", self);
+                        log("prompting for [user/]pw...", this);
                         if (cal.auth.getCredentials(cal.calGetString("wcap", "loginDialog.label"),
-                                                    self.sessionUri.hostPort,
+                                                    this.sessionUri.hostPort,
                                                     outUser,
                                                     outPW,
                                                     outSavePW,
-                                                    self.credentials.userId != null)) {
-                            self.login(request, promptAndLoginLoop_resp,
+                                                    this.credentials.userId != null)) {
+                            this.login(request, promptAndLoginLoop_resp,
                                        outUser.value, outPW.value);
                         } else {
-                            log("login prompt cancelled.", self);
-                            self.defaultCalendar.setProperty("disabled", true);
-                            self.defaultCalendar.setProperty("auto-enabled", true);
+                            log("login prompt cancelled.", this);
+                            this.defaultCalendar.setProperty("disabled", true);
+                            this.defaultCalendar.setProperty("auto-enabled", true);
                             respFunc(new Components.Exception(errorToString(calIWcapErrors.WCAP_LOGIN_FAILED),
                                                               calIWcapErrors.WCAP_LOGIN_FAILED));
                         }
                     } else if (loginerr) {
                         respFunc(loginerr);
                     } else {
                         if (outSavePW.value) {
                             // so try to remove old pw from db first:
-                            cal.auth.passwordManagerSave(outUser.value, outPW.value, self.uri.spec, "wcap login");
+                            cal.auth.passwordManagerSave(outUser.value, outPW.value, this.uri.spec, "wcap login");
                         }
-                        self.credentials.userId = outUser.value;
-                        self.credentials.pw = outPW.value;
-                        self.setupSession(sessionId,
-                                          request,
-                                          function(setuperr) {
-                                              respFunc(setuperr, sessionId);
-                                          });
+                        this.credentials.userId = outUser.value;
+                        this.credentials.pw = outPW.value;
+                        this.setupSession(sessionId, request, (setuperr) => respFunc(setuperr, sessionId));
                     }
-                }
+                };
 
                 if (outPW.value) {
-                    self.login(request, promptAndLoginLoop_resp, outUser.value, outPW.value);
+                    this.login(request, promptAndLoginLoop_resp, outUser.value, outPW.value);
                 } else {
                     promptAndLoginLoop_resp(calIWcapErrors.WCAP_LOGIN_FAILED);
                 }
             });
     },
 
     login: function(request, respFunc, user, pw) {
-        let self = this;
         issueNetworkRequest(
             request,
-            function(err, str) {
+            (err, str) => {
                 let sessionId;
                 try {
                     if (err) {
                         throw err;
                     }
                     // currently, xml parsing at an early stage during
                     // process startup does not work reliably, so use
                     // libical parsing for now:
-                    let icalRootComp = stringToIcal(self, str);
+                    let icalRootComp = stringToIcal(this, str);
                     let prop = icalRootComp.getFirstProperty("X-NSCP-WCAP-SESSION-ID");
                     if (!prop) {
                         throw new Components.Exception("missing X-NSCP-WCAP-SESSION-ID in\n" + str);
                     }
                     sessionId = prop.value;
                     prop = icalRootComp.getFirstProperty("X-NSCP-RECURRENCE-BOUND");
                     if (prop) {
                         let val = parseInt(prop.value, 10);
                         if (!isNaN(val)) {
-                            self.recurrenceBound = val;
-                            log("X-NSCP-RECURRENCE-BOUND:" + self.recurrenceBound);
+                            this.recurrenceBound = val;
+                            log("X-NSCP-RECURRENCE-BOUND:" + this.recurrenceBound);
                         }
                     }
-                    log("login succeeded: " + sessionId, self);
+                    log("login succeeded: " + sessionId, this);
                 } catch (exc) {
                     err = exc;
                     if (checkErrorCode(err, calIWcapErrors.WCAP_LOGIN_FAILED)) {
-                        log("error: " + errorToString(exc), self); // log login failure
+                        log("error: " + errorToString(exc), this); // log login failure
                     } else if (getErrorModule(err) == NS_ERROR_MODULE_NETWORK) {
                         // server seems unavailable:
                         err = new Components.Exception(cal.calGetString("wcap", "accessingServerFailedError.text",
-                                                                        [self.sessionUri.hostPort]), exc);
+                                                                        [this.sessionUri.hostPort]), exc);
                     }
                 }
                 respFunc(err, sessionId);
             },
-            self.sessionUri.spec + "login.wcap?fmt-out=text%2Fcalendar&user=" +
+            this.sessionUri.spec + "login.wcap?fmt-out=text%2Fcalendar&user=" +
             encodeURIComponent(user) + "&password=" + encodeURIComponent(pw),
             false /* no logging */);
     },
 
     logout: function(listener) {
-        let self = this;
         let request = new calWcapRequest(
-            function(oprequest, err) {
+            (oprequest, err) => {
                 if (err) {
-                    logError(err, self);
+                    logError(err, this);
                 } else {
-                    log("logout succeeded.", self);
+                    log("logout succeeded.", this);
                 }
                 if (listener) {
                     listener.onResult(oprequest, null);
                 }
             },
             log("logout", this));
 
         let url = null;
@@ -398,62 +389,61 @@ calWcapSession.prototype = {
             this.m_sessionId = null;
             getFreeBusyService().removeProvider(this);
             getCalendarSearchService().removeProvider(this);
         }
         this.m_credentials = null;
 
         if (url) {
             issueNetworkRequest(request,
-                                function(err, str) {
+                                (err, str) => {
                                     if (err) {
                                         throw err;
                                     }
-                                    stringToXml(self, str, -1 /* logout successfull */);
+                                    stringToXml(this, str, -1 /* logout successfull */);
                                 }, url);
         } else {
             request.execRespFunc();
         }
         return request;
     },
 
     checkServerVersion: function(request, respFunc) {
         // currently, xml parsing at an early stage during process startup
         // does not work reliably, so use libical:
-        let self = this;
         issueNetworkRequest(
             request,
-            function(err, str) {
+            (err, str) => {
                 try {
                     let icalRootComp;
                     if (!err) {
                         try {
-                            icalRootComp = stringToIcal(self, str);
+                            icalRootComp = stringToIcal(this, str);
                         } catch (exc) {
                             err = exc;
                         }
                     }
                     if (err) {
                         if (checkErrorCode(err, calIErrors.OPERATION_CANCELLED)) {
                             throw err;
                         } else { // soft error; request denied etc.
                                  // map into localized message:
                             throw new Components.Exception(cal.calGetString("wcap", "accessingServerFailedError.text",
-                                                                            [self.sessionUri.hostPort]),
+                                                                            [this.sessionUri.hostPort]),
                                                            calIWcapErrors.WCAP_LOGIN_FAILED);
                         }
                     }
                     let prop = icalRootComp.getFirstProperty("X-NSCP-WCAPVERSION");
                     if (!prop) {
                         throw new Components.Exception("missing X-NSCP-WCAPVERSION!");
                     }
                     let wcapVersion = parseInt(prop.value, 10);
                     if (wcapVersion < 3) {
                         let strVers = prop.value;
-                        let vars = [self.sessionUri.hostPort];
+                        let vars = [this.sessionUri.hostPort];
                         prop = icalRootComp.getFirstProperty("PRODID");
                         vars.push(prop ? prop.value : "<unknown>");
                         prop = icalRootComp.getFirstProperty("X-NSCP-SERVERVERSION");
                         vars.push(prop ? prop.value : "<unknown>");
                         vars.push(strVers);
 
                         let prompt = Services.ww.getNewPrompter(null);
                         let labelText = cal.calGetString("wcap", "insufficientWcapVersionConfirmation.label");
@@ -462,107 +452,105 @@ calWcapSession.prototype = {
                             throw new Components.Exception(labelText, calIWcapErrors.WCAP_LOGIN_FAILED);
                         }
                     }
                 } catch (exc) {
                     err = exc;
                 }
                 respFunc(err);
             },
-            self.sessionUri.spec + "version.wcap?fmt-out=text%2Fcalendar");
+            this.sessionUri.spec + "version.wcap?fmt-out=text%2Fcalendar");
     },
 
     setupSession: function(sessionId, request_, respFunc) {
-        let self = this;
         let request = new calWcapRequest(
-            function(oprequest, err) {
-                log("setupSession_resp finished: " + errorToString(err), self);
+            (oprequest, err) => {
+                log("setupSession_resp finished: " + errorToString(err), this);
                 respFunc(err);
             },
             log("setupSession", this));
         if (request_) {
             request_.attachSubRequest(request);
         }
 
         request.lockPending();
         try {
             this.issueNetworkRequest_(
                 request,
-                function(err, data) {
+                (err, data) => {
                     if (err) {
                         throw err;
                     }
-                    self.credentials.userPrefs = data;
-                    log("installed user prefs.", self);
+                    this.credentials.userPrefs = data;
+                    log("installed user prefs.", this);
 
                     // get calprops for all registered calendars:
-                    let cals = self.getRegisteredCalendars(true);
+                    let cals = this.getRegisteredCalendars(true);
 
                     let calprops_resp = null;
-                    let defaultCal = self.defaultCalendar;
+                    let defaultCal = this.defaultCalendar;
                     if (defaultCal && cals[defaultCal.calId] && // default calendar is registered
                         getPref("calendar.wcap.subscriptions", true) &&
                         !defaultCal.getProperty("subscriptions_registered")) {
                         let hasSubscriptions = false;
                         // post register subscribed calendars:
-                        let list = self.getUserPreferences("X-NSCP-WCAP-PREF-icsSubscribed");
+                        let list = this.getUserPreferences("X-NSCP-WCAP-PREF-icsSubscribed");
                         for (let item of list) {
                             let ar = item.split(",");
                             // ',', '$' are not encoded. ',' can be handled here. WTF.
                             for (let a of ar) {
                                 let dollar = a.indexOf("$");
                                 if (dollar >= 0) {
                                     let calId = a.substring(0, dollar);
-                                    if (calId != self.defaultCalId) {
+                                    if (calId != this.defaultCalId) {
                                         cals[calId] = null;
                                         hasSubscriptions = true;
                                     }
                                 }
                             }
                         }
 
                         if (hasSubscriptions) {
-                            calprops_resp = function(aCalendar) {
+                            calprops_resp = (aCalendar) => {
                                 if (aCalendar.isDefaultCalendar) {
                                     // tweak name:
                                     aCalendar.setProperty("name", aCalendar.displayName);
                                 } else {
-                                    log("registering subscribed calendar: " + aCalendar.calId, self);
+                                    log("registering subscribed calendar: " + aCalendar.calId, this);
                                     cal.getCalendarManager().registerCalendar(aCalendar);
                                 }
                             };
                             // do only once:
                             defaultCal.setProperty("subscriptions_registered", true);
                         }
                     }
 
                     if (!defaultCal.getProperty("user_id")) { // nail once:
-                        defaultCal.setProperty("user_id", self.credentials.userId);
+                        defaultCal.setProperty("user_id", this.credentials.userId);
                     }
 
                     if (getPref("calendar.wcap.no_get_calprops", false)) {
                         // hack around the get/search calprops mess:
-                        self.installCalProps_search_calprops(calprops_resp, sessionId, cals, request);
+                        this.installCalProps_search_calprops(calprops_resp, sessionId, cals, request);
                     } else {
-                        self.installCalProps_get_calprops(calprops_resp, sessionId, cals, request);
+                        this.installCalProps_get_calprops(calprops_resp, sessionId, cals, request);
                     }
                 },
                 stringToXml, "get_userprefs",
                 "&fmt-out=text%2Fxml&userid=" + encodeURIComponent(this.credentials.userId),
                 sessionId);
             this.installServerTimeDiff(sessionId, request);
             this.installServerTimezones(sessionId, request);
         } finally {
             request.unlockPending();
         }
     },
 
     installCalProps_get_calprops: function(respFunc, sessionId, cals, request) {
-        let self = this;
-        function calprops_resp(err, data) {
+        let calprops_resp = (err, data) => {
             if (err) {
                 throw err;
             }
             // string to xml converter func without WCAP errno check:
             if (!data || data.length == 0) { // assuming time-out
                 throw new Components.Exception(errorToString(calIWcapErrors.WCAP_LOGIN_FAILED),
                                                calIWcapErrors.WCAP_LOGIN_FAILED);
             }
@@ -572,49 +560,48 @@ calWcapSession.prototype = {
                 try {
                     let node = nodeList.item(i);
                     checkWcapXmlErrno(node);
                     let ar = filterXmlNodes("X-NSCP-CALPROPS-RELATIVE-CALID", node);
                     if (ar.length > 0) {
                         let calId = ar[0];
                         let calendar = cals[calId];
                         if (calendar === null) {
-                            calendar = new calWcapCalendar(self);
-                            let uri = self.uri.clone();
+                            calendar = new calWcapCalendar(this);
+                            let uri = this.uri.clone();
                             uri.path += "?calid=" + encodeURIComponent(calId);
                             calendar.uri = uri;
                         }
                         if (calendar) {
                             calendar.m_calProps = node;
                             if (respFunc) {
                                 respFunc(calendar);
                             }
                         }
                     }
                 } catch (exc) { // ignore but log any errors on subscribed calendars:
-                    logError(exc, self);
+                    logError(exc, this);
                 }
             }
-        }
+        };
 
         let calidParam = "";
         for (let calId in cals) {
             if (calidParam.length > 0) {
                 calidParam += ";";
             }
             calidParam += encodeURIComponent(calId);
         }
-        self.issueNetworkRequest_(request, calprops_resp,
+        this.issueNetworkRequest_(request, calprops_resp,
                                   null, "get_calprops",
                                   "&fmt-out=text%2Fxml&calid=" + calidParam,
                                   sessionId);
     },
 
     installCalProps_search_calprops: function(respFunc, sessionId, cals, request) {
-        let self = this;
         let retrievedCals = {};
         let issuedSearchRequests = {};
         for (let calId in cals) {
             if (!retrievedCals[calId]) {
                 let listener = {
                     onResult: function(oprequest, result) {
                         try {
                             if (!Components.isSuccessCode(oprequest.status)) {
@@ -630,21 +617,21 @@ calWcapSession.prototype = {
                                     let thisCalId = calendar.calId;
                                     if ((cals[thisCalId] !== undefined) && !retrievedCals[thisCalId]) {
                                         retrievedCals[thisCalId] = calendar;
                                         if (respFunc) {
                                             respFunc(calendar);
                                         }
                                     }
                                 } catch (exc) { // ignore but log any errors on subscribed calendars:
-                                    logError(exc, self);
+                                    logError(exc, this);
                                 }
                             }
                         } catch (exc) { // ignore but log any errors on subscribed calendars:
-                            logError(exc, self);
+                            logError(exc, this);
                         }
                     }
                 };
 
                 let colon = calId.indexOf(":");
                 if (colon >= 0) { // searching for secondary calendars doesn't work. WTF.
                     calId = calId.substring(0, colon);
                 }
@@ -652,103 +639,99 @@ calWcapSession.prototype = {
                     issuedSearchRequests[calId] = true;
                     this.searchForCalendars(calId, calICalendarSearchProvider.HINT_EXACT_MATCH, 20, listener);
                 }
             }
         }
     },
 
     installServerTimeDiff: function(sessionId, request) {
-        let self = this;
         this.issueNetworkRequest_(
             request,
-            function(err, data) {
+            (err, data) => {
                 if (err) {
                     throw err;
                 }
                 // xxx todo: think about
                 // assure that locally calculated server time is smaller
                 // than the current (real) server time:
                 let localTime = getTime();
                 let serverTime = getDatetimeFromIcalProp(data.getFirstProperty("X-NSCP-WCAPTIME"));
-                self.m_serverTimeDiff = serverTime.subtractDate(localTime);
-                log("server time diff is: " + self.m_serverTimeDiff, self);
+                this.m_serverTimeDiff = serverTime.subtractDate(localTime);
+                log("server time diff is: " + this.m_serverTimeDiff, this);
             },
             stringToIcal, "gettime", "&fmt-out=text%2Fcalendar",
             sessionId);
     },
 
     installServerTimezones: function(sessionId, request) {
         this.m_serverTimezones = {};
-        let self = this;
-        self.issueNetworkRequest_(
+        this.issueNetworkRequest_(
             request,
-            function(err, data) {
+            (err, data) => {
                 if (err) {
                     throw err;
                 }
                 for (let subComp of cal.ical.calendarComponentIterator(data, "VTIMEZONE")) {
                     try {
                         let tzid = subComp.getFirstProperty("TZID").value;
-                        self.m_serverTimezones[tzid] = new calWcapTimezone(self, tzid, subComp);
+                        this.m_serverTimezones[tzid] = new calWcapTimezone(this, tzid, subComp);
                     } catch (exc) { // ignore but errors:
-                        logError(exc, self);
+                        logError(exc, this);
                     }
                 }
-                log("installed timezones.", self);
+                log("installed timezones.", this);
             },
             stringToIcal, "get_all_timezones", "&fmt-out=text%2Fcalendar",
             sessionId);
     },
 
     getCommandUrl: function(wcapCommand, params, sessionId) {
         let url = this.sessionUri.spec;
         url += wcapCommand + ".wcap?appid=mozilla-calendar&id=";
         url += sessionId;
         url += params;
         return url;
     },
 
     issueNetworkRequest: function(request, respFunc, dataConvFunc, wcapCommand, params) {
-        let self = this;
-        let getSessionId_resp = function(err, sessionId) {
+        let getSessionId_resp = (err, sessionId) => {
             if (err) {
                 request.execSubRespFunc(respFunc, err);
             } else {
                 // else have session uri and id:
-                self.issueNetworkRequest_(
+                this.issueNetworkRequest_(
                     request,
-                    function(loginerr, data) {
+                    (loginerr, data) => {
                         // timeout?
                         if (checkErrorCode(loginerr, calIWcapErrors.WCAP_LOGIN_FAILED)) {
                             // try again:
-                            self.getSessionId(
+                            this.getSessionId(
                                 request,
                                 getSessionId_resp,
                                 sessionId/* (old) timed-out session */);
                             return;
                         }
                         request.execSubRespFunc(respFunc, loginerr, data);
                     },
                     dataConvFunc, wcapCommand, params, sessionId);
             }
         };
         this.getSessionId(request, getSessionId_resp);
     },
 
     issueNetworkRequest_: function(request, respFunc, dataConvFunc, wcapCommand, params, sessionId) {
         let url = this.getCommandUrl(wcapCommand, params, sessionId);
-        let self = this;
         issueNetworkRequest(request,
-                            function(err, str) {
+                            (err, str) => {
                                 let data;
                                 if (!err) {
                                     try {
                                         if (dataConvFunc) {
-                                            data = dataConvFunc(self, str);
+                                            data = dataConvFunc(this, str);
                                         } else {
                                             data = str;
                                         }
                                     } catch (exc) {
                                         err = exc;
                                     }
                                 }
                                 request.execSubRespFunc(respFunc, err, data);
@@ -859,21 +842,20 @@ calWcapSession.prototype = {
             }
         }
         out_count.value = ret.length;
         return ret;
     },
 
     // calICalendarSearchProvider:
     searchForCalendars: function(searchString, hints, maxResults, listener) {
-        let self = this;
         let request = new calWcapRequest(
-            function(oprequest, err, data) {
+            (oprequest, err, data) => {
                 if (err && !checkErrorCode(err, calIErrors.OPERATION_CANCELLED)) {
-                    self.notifyError(err);
+                    this.notifyError(err);
                 }
                 if (listener) {
                     listener.onResult(oprequest, data);
                 }
             },
             log("searchForCalendars, searchString=" + searchString, this));
 
         try {
@@ -883,17 +865,17 @@ calWcapSession.prototype = {
             if (maxResults > 0) {
                 params += "&maxResults=" + maxResults;
             }
             params += "&name=1&calid=1&primaryOwner=1&searchOpts=" +
                        (hints & calICalendarSearchProvider.HINT_EXACT_MATCH ? "3" : "0");
 
             this.issueNetworkRequest(
                 request,
-                function(err, data) {
+                (err, data) => {
                     if (err) {
                         throw err;
                     }
                     // string to xml converter func without WCAP errno check:
                     if (!data || data.length == 0) { // assuming time-out
                         throw new Components.Exception(errorToString(calIWcapErrors.WCAP_LOGIN_FAILED),
                                                        calIWcapErrors.WCAP_LOGIN_FAILED);
                     }
@@ -906,65 +888,64 @@ calWcapSession.prototype = {
                             checkWcapXmlErrno(node);
                             let ar = filterXmlNodes("X-NSCP-CALPROPS-RELATIVE-CALID", node);
                             if (ar.length > 0) {
                                 let calId = ar[0];
                                 let calendar = registeredCalendars[calId];
                                 if (calendar) {
                                     calendar.m_calProps = node; // update calprops
                                 } else {
-                                    calendar = new calWcapCalendar(self, node);
-                                    let uri = self.uri.clone();
+                                    calendar = new calWcapCalendar(this, node);
+                                    let uri = this.uri.clone();
                                     uri.path += "?calid=" + encodeURIComponent(calId);
                                     calendar.uri = uri;
                                 }
                                 ret.push(calendar);
                             }
                         } catch (exc) {
                             switch (getResultCode(exc)) {
                                 case calIWcapErrors.WCAP_NO_ERRNO: // workaround
                                 case calIWcapErrors.WCAP_ACCESS_DENIED_TO_CALENDAR:
-                                    log("searchForCalendars_netResp() ignored error: " + errorToString(exc), self);
+                                    log("searchForCalendars_netResp() ignored error: " + errorToString(exc), this);
                                     break;
                                 default:
-                                    self.notifyError(exc);
+                                    this.notifyError(exc);
                                     break;
                             }
                         }
                     }
-                    log("search done. number of found calendars: " + ret.length, self);
+                    log("search done. number of found calendars: " + ret.length, this);
                     request.execRespFunc(null, ret);
                 },
                 null, "search_calprops", params);
         } catch (exc) {
             request.execRespFunc(exc);
         }
         return request;
     },
 
     // calIFreeBusyProvider:
     getFreeBusyIntervals: function(calId, rangeStart, rangeEnd, busyTypes, listener) {
         rangeStart = ensureDateTime(rangeStart);
         rangeEnd = ensureDateTime(rangeEnd);
         let zRangeStart = getIcalUTC(rangeStart);
         let zRangeEnd = getIcalUTC(rangeEnd);
 
-        let self = this;
         let request = new calWcapRequest(
-            function(oprequest, err, data) {
+            (oprequest, err, data) => {
                 let rc = getResultCode(err);
                 switch (rc) {
                     case calIWcapErrors.WCAP_NO_ERRNO: // workaround
                     case calIWcapErrors.WCAP_ACCESS_DENIED_TO_CALENDAR:
                     case calIWcapErrors.WCAP_CALENDAR_DOES_NOT_EXIST:
-                        log("getFreeBusyIntervals_resp() error: " + errorToString(err), self);
+                        log("getFreeBusyIntervals_resp() error: " + errorToString(err), this);
                         break;
                     default:
                         if (!Components.isSuccessCode(rc)) {
-                            self.notifyError(err);
+                            this.notifyError(err);
                         }
                         break;
                 }
                 if (listener) {
                     listener.onResult(oprequest, data);
                 }
             },
             log("getFreeBusyIntervals():\n\tcalId=" + calId +
@@ -984,23 +965,23 @@ calWcapSession.prototype = {
             let params = "&calid=" + encodeURIComponent(calId);
             params += "&busyonly=" + (busyTypes & calIFreeBusyInterval.FREE ? "0" : "1");
             params += "&dtstart=" + zRangeStart;
             params += "&dtend=" + zRangeEnd;
             params += "&fmt-out=text%2Fxml";
 
             this.issueNetworkRequest(
                 request,
-                function(err, xml) {
+                (err, xml) => {
                     if (err) {
                         throw err;
                     }
                     if (LOG_LEVEL > 0) {
                         log("getFreeBusyIntervals net_resp(): " +
-                            getWcapRequestStatusString(xml), self);
+                            getWcapRequestStatusString(xml), this);
                     }
                     if (listener) {
                         let ret = [];
                         let nodeList = xml.getElementsByTagName("FB");
 
                         let fbTypeMap = {};
                         fbTypeMap.FREE = calIFreeBusyInterval.FREE;
                         fbTypeMap.BUSY = calIFreeBusyInterval.BUSY;
--- a/calendar/test/mozmill/eventDialog/testEventDialog.js
+++ b/calendar/test/mozmill/eventDialog/testEventDialog.js
@@ -55,17 +55,17 @@ var testEventDialog = function() {
 
   // pick day
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, miniMonth +
     'anon({"anonid":"minimonth-calendar"})/[1]/{"value":"1"}'));
   controller.sleep(sleep);
 
   // create new event
   controller.mainMenu.click("#ltnNewEvent");
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
   // check that the start time is correct
   // next full hour except last hour hour of the day
   let now = new Date();
   let hour = now.getHours();
   let startHour = (hour == 23) ? hour : (hour + 1) % 24;
   let ampm = "";
@@ -136,22 +136,22 @@ var testEventDialog = function() {
   event.assertNode(new elementslib.Lookup(event.window.document, eventDialog +
     'id("event-grid-attachment-row")/id("attachment-link")/{"label":"mozilla.org"}'));
 
   // save
   calUtils.acceptSendingNotificationMail(event);
   event.click(new elementslib.ID(event.window.document, "button-save"));
 
   // catch and dismiss alarm
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:AlarmWindow").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:AlarmWindow").length > 0, sleep);
   let alarm = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:AlarmWindow")[0]);
   // dismiss all button, label in .dtd file, bug #504635
   alarm.waitThenClick(new elementslib.Lookup(alarm.window.document, '/id("calendar-alarm-dialog")/' +
     'id("alarm-actionbar")/[1]'));
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:AlarmWindow").length == 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:AlarmWindow").length == 0, sleep);
 
   // verify event and alarm icon visible every day of the month and check tooltip
   // 1st January is Thursday so there's three days to check in the first row
   controller.assertNode(new elementslib.Lookup(controller.window.document,
     eventBox.replace("rowNumber", "0").replace("columnNumber", "4")));
   checkIcon(eventBox, "0", "4");
   checkTooltip(monthView, "0", "4", "1", startTime, endTime);
 
--- a/calendar/test/mozmill/eventDialog/testUTF8.js
+++ b/calendar/test/mozmill/eventDialog/testUTF8.js
@@ -20,17 +20,17 @@ var testUTF8 = function() {
   let eventDialog = '/id("calendar-event-dialog")/id("event-grid")/id("event-grid-rows")/';
 
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
 
   // create new event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, 8)));
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
   // fill in name, location, description
   let titleTextBox = new elementslib.Lookup(event.window.document, eventDialog +
     'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/' +
     'anon({"anonid":"input"})');
   event.waitForElement(titleTextBox);
   event.type(titleTextBox, UTF8string);
@@ -51,17 +51,17 @@ var testUTF8 = function() {
   event.click(new elementslib.ID(event.window.document, "button-save"));
 
   // open
   let eventBox = new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, 8) +
     '/{"tooltip":"itemTooltip","calendar":"' + UTF8string.toLowerCase() + '"}');
   controller.waitForElement(eventBox);
   controller.doubleClick(eventBox);
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
   // check values
   titleTextBox = new elementslib.Lookup(event.window.document, eventDialog +
     'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/' +
     'anon({"anonid":"input"})');
   event.waitForElement(titleTextBox);
   event.assertValue(titleTextBox, UTF8string);
--- a/calendar/test/mozmill/recurrence/testAnnualRecurrence.js
+++ b/calendar/test/mozmill/recurrence/testAnnualRecurrence.js
@@ -21,17 +21,17 @@ var testAnnualRecurrence = function() {
   controller.sleep(sleep);
 
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, startYear, 1, 1);
 
   // create yearly recurring all-day event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.ALLDAY, undefined, 1, undefined)));
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils
                  .getWindows("Calendar:EventDialog")[0]);
   event.sleep(sleep);
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined,
     "yearly");
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.sleep(sleep);
 
--- a/calendar/test/mozmill/recurrence/testBiweeklyRecurrence.js
+++ b/calendar/test/mozmill/recurrence/testBiweeklyRecurrence.js
@@ -18,23 +18,23 @@ var testBiweeklyRecurrence = function() 
 
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 31);
 
   // create biweekly event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "bi.weekly");
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length == 0; });
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length == 0);
 
   let box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour) +
     eventPath;
 
   // check day view
   for (let i = 0; i < 4; i++) {
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     calUtils.forward(controller, 14);
--- a/calendar/test/mozmill/recurrence/testDailyRecurrence.js
+++ b/calendar/test/mozmill/recurrence/testDailyRecurrence.js
@@ -18,17 +18,17 @@ var testDailyRecurrence = function() {
 
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 1);
 
   // create daily event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
 
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined,
     "daily");
   event.click(new elementslib.ID(event.window.document, "button-save"));
 
@@ -125,25 +125,25 @@ var testDailyRecurrence = function() {
   // go to previous day to edit event to occur only on weekdays
   calUtils.back(controller, 1);
 
   calUtils.handleParentModification(controller, false);
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour) +
       eventPath));
 
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
 
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined,
     "every.weekday");
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length == 0; });
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length == 0);
 
   // check day view for 7 days
   let day = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, undefined) +
     eventPath;
   let dates = [[2009, 1, 3],
                [2009, 1, 4]];
   for (let i = 0; i < dates.length; i++) {
     calUtils.goToDate(controller, dates[i][0], dates[i][1], dates[i][2]);
--- a/calendar/test/mozmill/recurrence/testLastDayOfMonthRecurrence.js
+++ b/calendar/test/mozmill/recurrence/testLastDayOfMonthRecurrence.js
@@ -18,28 +18,28 @@ var testLastDayOfMonthRecurrence = funct
   let eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2008, 1, 31); // start with a leap year
 
   // create monthly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
 
   let md = new modalDialog.modalDialog(event.window);
   md.start(setRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined,
     "custom");
 
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length == 0; });
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length == 0);
 
   //                        date     correct row in month view
   let checkingData = [[2008, 1, 31, 5],
                       [2008, 2, 29, 5],
                       [2008, 3, 31, 6],
                       [2008, 4, 30, 5],
                       [2008, 5, 31, 5],
                       [2008, 6, 30, 5],
--- a/calendar/test/mozmill/recurrenceRotated/testAnnualRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testAnnualRecurrence.js
@@ -18,25 +18,25 @@ var testAnnualRecurrence = function() {
   let eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
 
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, startYear, 1, 1);
 
   // rotate view
   controller.mainMenu.click("#ltnViewRotated");
-  controller.waitFor(function() {
+  controller.waitFor(() => {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "horizontal";
   });
 
   // create yearly recurring all-day event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.ALLDAY, undefined, 1, undefined)));
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils
                  .getWindows("Calendar:EventDialog")[0]);
   event.sleep(sleep);
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined,
     "yearly");
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.sleep(sleep);
 
@@ -80,17 +80,17 @@ var testAnnualRecurrence = function() {
   calUtils.handleParentDeletion(controller, false);
   controller.click(new elementslib.Lookup(controller.window.document, box));
   controller.keypress(new elementslib.ID(controller.window.document, "day-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, box));
 
   // reset view
   controller.mainMenu.click("#ltnViewRotated");
-  controller.waitFor(function() {
+  controller.waitFor(() => {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "vertical";
   });
 };
 
 var teardownTest = function(module) {
   calUtils.deleteCalendars(controller, calendar);
 };
--- a/calendar/test/mozmill/recurrenceRotated/testBiweeklyRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testBiweeklyRecurrence.js
@@ -17,31 +17,31 @@ var testBiweeklyRecurrence = function() 
   let eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
 
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 31);
 
   // rotate view
   controller.mainMenu.click("#ltnViewRotated");
-  controller.waitFor(function() {
+  controller.waitFor(() => {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "horizontal";
   });
 
   // create biweekly event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "bi.weekly");
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length == 0; });
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length == 0);
 
   let box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour) +
     eventPath;
 
   // check day view
   for (let i = 0; i < 4; i++) {
     controller.assertNode(new elementslib.Lookup(controller.window.document, box));
     calUtils.forward(controller, 14);
@@ -105,17 +105,17 @@ var testBiweeklyRecurrence = function() 
   calUtils.handleParentDeletion(controller, false);
   controller.keypress(new elementslib.ID(controller.window.document, "month-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, box));
 
   // reset view
   calUtils.switchToView(controller, "day");
   controller.mainMenu.click("#ltnViewRotated");
-  controller.waitFor(function() {
+  controller.waitFor(() => {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "vertical";
   });
 };
 
 var teardownTest = function(module) {
   calUtils.deleteCalendars(controller, calendar);
 };
--- a/calendar/test/mozmill/recurrenceRotated/testDailyRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testDailyRecurrence.js
@@ -17,25 +17,25 @@ var testDailyRecurrence = function() {
   let eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
 
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 1);
 
   // rotate view
   controller.mainMenu.click("#ltnViewRotated");
-  controller.waitFor(function() {
+  controller.waitFor(() => {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "horizontal";
   });
 
   // create daily event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
 
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined,
     "daily");
   event.click(new elementslib.ID(event.window.document, "button-save"));
 
@@ -132,25 +132,25 @@ var testDailyRecurrence = function() {
   // go to previous day to edit event to occur only on weekdays
   calUtils.back(controller, 1);
 
   calUtils.handleParentModification(controller, false);
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour) +
       eventPath));
 
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
 
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined,
     "every.weekday");
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length == 0; });
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length == 0);
 
   // check day view for 7 days
   let day = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, undefined) +
     eventPath;
   let dates = [[2009, 1, 3],
                [2009, 1, 4]];
   for (let i = 0; i < dates.length; i++) {
     calUtils.goToDate(controller, dates[i][0], dates[i][1], dates[i][2]);
@@ -204,17 +204,17 @@ var testDailyRecurrence = function() {
   calUtils.handleParentDeletion(controller, false);
   controller.keypress(new elementslib.ID(controller.window.document, "month-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, day));
 
   // reset view
   calUtils.switchToView(controller, "day");
   controller.mainMenu.click("#ltnViewRotated");
-  controller.waitFor(function() {
+  controller.waitFor(() => {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "vertical";
   });
 };
 
 var teardownTest = function(module) {
   calUtils.deleteCalendars(controller, calendar);
 };
--- a/calendar/test/mozmill/recurrenceRotated/testLastDayOfMonthRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testLastDayOfMonthRecurrence.js
@@ -17,36 +17,36 @@ var setupModule = function(module) {
 var testLastDayOfMonthRecurrence = function() {
   let eventPath = '/{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}';
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2008, 1, 31); // start with a leap year
 
   // rotate view
   controller.mainMenu.click("#ltnViewRotated");
-  controller.waitFor(function() {
+  controller.waitFor(() => {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "horizontal";
   });
 
   // create monthly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
 
   let md = new modalDialog.modalDialog(event.window);
   md.start(setRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined,
     "custom");
 
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length == 0; });
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length == 0);
 
   //                      date      correct row in month view
   //                   vvvvvvvvvvv  v
   let checkingData = [[2008, 1, 31, 5],
                       [2008, 2, 29, 5],
                       [2008, 3, 31, 6],
                       [2008, 4, 30, 5],
                       [2008, 5, 31, 5],
@@ -101,17 +101,17 @@ var testLastDayOfMonthRecurrence = funct
   calUtils.handleParentDeletion(controller, false);
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, box));
   controller.keypress(new elementslib.ID(controller.window.document, "day-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, box));
 
   // reset view
   controller.mainMenu.click("#ltnViewRotated");
-  controller.waitFor(function() {
+  controller.waitFor(() => {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "vertical";
   });
 };
 
 function setRecurrence(recurrence) {
   recurrence.sleep(sleep);
 
--- a/calendar/test/mozmill/recurrenceRotated/testWeeklyNRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testWeeklyNRecurrence.js
@@ -18,17 +18,17 @@ var setupModule = function(module) {
 
 var testWeeklyNRecurrence = function() {
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 5);
 
   // rotate view
   controller.mainMenu.click("#ltnViewRotated");
-  controller.waitFor(function() {
+  controller.waitFor(() => {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "horizontal";
   });
 
   // create weekly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
@@ -85,17 +85,17 @@ var testWeeklyNRecurrence = function() {
   calUtils.handleParentDeletion(controller, false);
   controller.keypress(new elementslib.ID(controller.window.document, "month-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, box));
 
   // reset view
   calUtils.switchToView(controller, "day");
   controller.mainMenu.click("#ltnViewRotated");
-  controller.waitFor(function() {
+  controller.waitFor(() => {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "vertical";
   });
 };
 
 function setRecurrence(recurrence) {
   // weekly
   recurrence.waitForElement(new elementslib.ID(recurrence.window.document, "period-list"));
--- a/calendar/test/mozmill/recurrenceRotated/testWeeklyUntilRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testWeeklyUntilRecurrence.js
@@ -19,17 +19,17 @@ var setupModule = function(module) {
 
 var testWeeklyUntilRecurrence = function() {
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 5); // Monday
 
   // rotate view
   controller.mainMenu.click("#ltnViewRotated");
-  controller.waitFor(function() {
+  controller.waitFor(() => {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "horizontal";
   });
 
   // create weekly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
@@ -112,17 +112,17 @@ var testWeeklyUntilRecurrence = function
   calUtils.handleParentDeletion(controller, false);
   controller.keypress(new elementslib.ID(controller.window.document, "month-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, box));
 
   // reset view
   calUtils.switchToView(controller, "day");
   controller.mainMenu.click("#ltnViewRotated");
-  controller.waitFor(function() {
+  controller.waitFor(() => {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "vertical";
   });
 };
 
 function setRecurrence(recurrence) {
   // weekly
   recurrence.waitForElement(new elementslib.ID(recurrence.window.document, "period-list"));
--- a/calendar/test/mozmill/recurrenceRotated/testWeeklyWithExceptionRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testWeeklyWithExceptionRecurrence.js
@@ -19,17 +19,17 @@ var setupModule = function(module) {
 
 var testWeeklyWithExceptionRecurrence = function() {
   controller.click(new elementslib.ID(controller.window.document, "calendar-tab-button"));
   calUtils.switchToView(controller, "day");
   calUtils.goToDate(controller, 2009, 1, 5);
 
   // rotate view
   controller.mainMenu.click("#ltnViewRotated");
-  controller.waitFor(function() {
+  controller.waitFor(() => {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "horizontal";
   });
 
   // create weekly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
@@ -204,17 +204,17 @@ var testWeeklyWithExceptionRecurrence = 
   controller.click(new elementslib.Lookup(controller.window.document, path));
   calUtils.handleParentDeletion(controller, false);
   controller.keypress(new elementslib.ID(controller.window.document, "day-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document, path));
 
   // reset view
   controller.mainMenu.click("#ltnViewRotated");
-  controller.waitFor(function() {
+  controller.waitFor(() => {
     let view = (new elementslib.ID(controller.window.document, "day-view")).getNode();
     return view.orient == "vertical";
   });
 };
 
 function setRecurrence(recurrence) {
   // weekly
   recurrence.waitForElement(new elementslib.ID(recurrence.window.document, "period-list"));
--- a/calendar/test/mozmill/shared-modules/calendar-utils.js
+++ b/calendar/test/mozmill/shared-modules/calendar-utils.js
@@ -17,31 +17,31 @@ var EVENT_BOX = 0; // Use when you need 
 var CANVAS_BOX = 1; // Use when you need a calendar canvas box
 var ALLDAY = 2; // Use when you need an allday canvas or event box
 
 /**
  *  Accept to send notification email with event to attendees
  *  @param controller - Mozmill window controller
  */
 function acceptSendingNotificationMail(controller) {
-  modalDialog.plan_for_modal_dialog("commonDialog", function(dialog) {
+  modalDialog.plan_for_modal_dialog("commonDialog", (dialog) => {
       dialog.waitThenClick(new elementslib.Lookup(dialog.window.document, '/id("commonDialog")/' +
         'anon({"anonid":"buttons"})/{"dlgtype":"accept"}'));
     }
   );
 
   modalDialog.wait_for_modal_dialog("commonDialog");
 }
 
 /**
  *  Add an attachment with url
  *  @param controller - Mozmill window controller
  */
 function handleAddingAttachment(controller, url) {
-  modalDialog.plan_for_modal_dialog("commonDialog", function(attachment) {
+  modalDialog.plan_for_modal_dialog("commonDialog", (attachment) => {
     let input = new elementslib.ID(attachment.window.document, "loginTextbox");
     attachment.waitForElement(input);
     input.getNode().value = url;
     attachment.click(new elementslib.Lookup(attachment.window.document, '/id("commonDialog")/' +
       'anon({"anonid":"buttons"})/{"dlgtype":"accept"}'));
   });
 
   modalDialog.wait_for_modal_dialog("commonDialog");
@@ -100,44 +100,44 @@ function handleParentModification(contro
  *  @param controller - Mozmill window controller
  *  @param view - day, week, multiweek or month
  */
 function switchToView(controller, view) {
   switch (view) {
     case "week":
       controller.waitThenClick(new elementslib.ID(controller.window.document,
         "calendar-week-view-button"));
-      controller.waitFor(function() {
+      controller.waitFor(() => {
         let button = new elementslib.ID(controller.window.document,
         "calendar-week-view-button");
         return button.getNode().selected == true;
       });
       break;
     case "multiweek":
       controller.waitThenClick(new elementslib.ID(controller.window.document,
         "calendar-multiweek-view-button"));
-      controller.waitFor(function() {
+      controller.waitFor(() => {
         let button = new elementslib.ID(controller.window.document,
         "calendar-multiweek-view-button");
         return button.getNode().selected == true;
       });
       break;
     case "month":
       controller.waitThenClick(new elementslib.ID(controller.window.document,
         "calendar-month-view-button"));
-      controller.waitFor(function() {
+      controller.waitFor(() => {
         let button = new elementslib.ID(controller.window.document,
         "calendar-month-view-button");
         return button.getNode().selected == true;
       });
       break;
     default:
       controller.waitThenClick(new elementslib.ID(controller.window.document,
         "calendar-day-view-button"));
-      controller.waitFor(function() {
+      controller.waitFor(() => {
         let button = new elementslib.ID(controller.window.document,
         "calendar-day-view-button");
         return button.getNode().selected == true;
       });
   }
 }
 
 /**
--- a/calendar/test/mozmill/testLocalICS.js
+++ b/calendar/test/mozmill/testLocalICS.js
@@ -41,17 +41,17 @@ var testLocalICS = function() {
 
   modalDialog.plan_for_modal_dialog("Calendar:NewCalendarWizard", handleNewCalendarWizard);
   controller.mainMenu.click("#ltnNewCalendar");
   modalDialog.wait_for_modal_dialog("Calendar:NewCalendarWizard", TIMEOUT_MODAL_DIALOG);
 
   // create new event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
 
   // let the iframe load
   let iframe = event.window.document.getElementById("lightning-item-panel-iframe");
   event.waitFor(() => iframe.contentWindow.onLoad && iframe.contentWindow.onLoad.hasLoaded == true);
 
   // title
@@ -122,14 +122,14 @@ function handleNewCalendarWizard(wizard)
   // enter location
   wizard.type(new elementslib.Lookup(wizard.window.document, '/id("calendar-wizard")/' +
     '{"pageid":"locationPage"}/[1]/[1]/{"align":"center"}/id("calendar-uri")/' +
     'anon({"class":"textbox-input-box"})/anon({"anonid":"input"})'),
     uri);
   docEl.getButton("next").doCommand();
 
   // name is filled in automatically using filename
-  wizard.waitFor(function() { return docEl.getButton("next").disabled == false; });
+  wizard.waitFor(() => docEl.getButton("next").disabled == false);
   docEl.getButton("next").doCommand();
 
   // finish
   docEl.getButton("finish").doCommand();
 }
--- a/calendar/test/mozmill/testTodayPane.js
+++ b/calendar/test/mozmill/testTodayPane.js
@@ -54,64 +54,64 @@ var testTodayPane = function() {
   if (startHour < 8 || startHour > 16) {
     view.scrollToMinute(60 * startHour);
   }
 
   controller.doubleClick(new elementslib.Lookup(controller.window.document, dayView +
     'anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/anon({"anonid":"daybox"})/' +
     '{"class":"calendar-event-column-even"}/anon({"anonid":"boxstack"})/' +
     'anon({"anonid":"bgbox"})/[' + startHour + "]"), 1, 1);
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, WAIT_FOR_WINDOW_TIMEOUT);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, WAIT_FOR_WINDOW_TIMEOUT);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
   let iframe = event.window.document.getElementById("lightning-item-panel-iframe");
   event.waitFor(() => iframe.contentWindow.onLoad && iframe.contentWindow.onLoad.hasLoaded == true);
 
   event.waitForElement(new elementslib.Lookup(iframe.contentDocument, eventName));
   event.type(new elementslib.Lookup(iframe.contentDocument, eventName), "Today's Event");
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length == 0; });
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length == 0);
 
   // reset view
   view.scrollToMinute(60 * 8);
 
   // go to tomorrow and add an event
   controller.click(new elementslib.ID(controller.window.document, "next-view-button"));
   controller.doubleClick(new elementslib.Lookup(controller.window.document, dayView +
     'anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/anon({"anonid":"daybox"})/' +
     '{"class":"calendar-event-column-even"}/anon({"anonid":"boxstack"})/' +
     'anon({"anonid":"bgbox"})/[9]'), 1, 1);
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, WAIT_FOR_WINDOW_TIMEOUT);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, WAIT_FOR_WINDOW_TIMEOUT);
   event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
   iframe = event.window.document.getElementById("lightning-item-panel-iframe");
   event.waitFor(() => iframe.contentWindow.onLoad && iframe.contentWindow.onLoad.hasLoaded == true);
 
   event.waitForElement(new elementslib.Lookup(iframe.contentDocument, eventName));
   event.type(new elementslib.Lookup(iframe.contentDocument, eventName), "Tomorrow's Event");
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length == 0; });
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length == 0);
 
   // go 5 days forward and add an event
   for (let i = 0; i < 5; i++) {
     controller.click(new elementslib.ID(controller.window.document, "next-view-button"));
   }
   controller.sleep(WAIT_FOR_WINDOW_TIMEOUT);
 
   controller.doubleClick(new elementslib.Lookup(controller.window.document, dayView +
     'anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/anon({"anonid":"daybox"})/' +
     '{"class":"calendar-event-column-even"}/anon({"anonid":"boxstack"})/' +
     'anon({"anonid":"bgbox"})/[9]'), 1, 1);
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, WAIT_FOR_WINDOW_TIMEOUT);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, WAIT_FOR_WINDOW_TIMEOUT);
   event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
   iframe = event.window.document.getElementById("lightning-item-panel-iframe");
   event.waitFor(() => iframe.contentWindow.onLoad && iframe.contentWindow.onLoad.hasLoaded == true);
 
   event.waitForElement(new elementslib.Lookup(iframe.contentDocument, eventName));
   event.type(new elementslib.Lookup(iframe.contentDocument, eventName), "Future's Event");
   event.click(new elementslib.ID(event.window.document, "button-save"));
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length == 0; });
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length == 0);
 
   // go to mail tab
   controller.click(new elementslib.Lookup(controller.window.document, '/id("messengerWindow")/' +
     'id("navigation-toolbox")/id("tabs-toolbar")/id("tabcontainer")/{"first-tab":"true","type":"folder"}/' +
     'anon({"class":"tab-stack"})/{"class":"tab-background"}/{"class":"tab-background-middle"}'));
   controller.sleep(WAIT_FOR_WINDOW_TIMEOUT);
 
   // verify today pane open
--- a/calendar/test/mozmill/views/testDayView.js
+++ b/calendar/test/mozmill/views/testDayView.js
@@ -48,24 +48,24 @@ var testDayView = function() {
     'anon({"anonid":"minimonth-header"})/anon({"anonid":"minmonth-popupset"})/' +
     'anon({"anonid":"months-popup"})/[0]/{"index":"0"}'));
 
   // pick day
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, miniMonth +
     'anon({"anonid":"minimonth-calendar"})/[1]/{"value":"1"}'));
 
   // verify date in view
-  controller.waitFor(function() { return day.getNode().mDate.icalString == "20090101"; });
+  controller.waitFor(() => day.getNode().mDate.icalString == "20090101");
 
   // create event at 8 AM
   controller.doubleClick(new elementslib.Lookup(controller.window.document, dayView +
     'anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/anon({"anonid":"daybox"})/' +
     '{"class":"calendar-event-column-even"}/anon({"anonid":"boxstack"})/' +
     'anon({"anonid":"bgbox"})/[8]'), 1, 1);
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
   // check that the start time is correct
   let startTimeInput = new elementslib.Lookup(event.window.document, eventDialog +
     'id("event-grid-startdate-row")/id("event-grid-startdate-picker-box")/' +
     'id("event-starttime")/anon({"anonid":"hbox"})/anon({"anonid":"time-picker"})/' +
     'anon({"class":"timepicker-box-class"})/anon({"class":"timepicker-text-class"})/' +
     'anon({"flex":"1"})/anon({"anonid":"input"})');
@@ -98,17 +98,17 @@ var testDayView = function() {
   // if it was created successfully, it can be opened
   let eventBox = new elementslib.Lookup(controller.window.document, dayView +
     'anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/anon({"anonid":"daybox"})/' +
     '{"class":"calendar-event-column-even"}/anon({"anonid":"boxstack"})/' +
     'anon({"anonid":"topbox"})/{"flex":"1"}/{"flex":"1"}/[0]/' +
     '{"tooltip":"itemTooltip","calendar":"' + calendar.toLowerCase() + '"}');
   controller.waitForElement(eventBox);
   controller.doubleClick(eventBox);
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
   // change title and save changes
   let titleTextBox = new elementslib.Lookup(event.window.document, eventDialog +
     'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/' +
     'anon({"anonid":"input"})');
   event.waitForElement(titleTextBox);
   event.type(titleTextBox, title2);
--- a/calendar/test/mozmill/views/testMonthView.js
+++ b/calendar/test/mozmill/views/testMonthView.js
@@ -52,25 +52,25 @@ var testMonthView = function() {
   // pick day
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, miniMonth +
     'anon({"anonid":"minimonth-calendar"})/[1]/{"value":"1"}'));
 
   // verify date
   let day = new elementslib.Lookup(controller.window.document, monthView +
     'anon({"anonid":"mainbox"})/anon({"anonid":"monthgrid"})/anon({"anonid":"monthgridrows"})/' +
     '[0]/{"selected":"true"}');
-  controller.waitFor(function() { return day.getNode().mDate.icalString == "20090101"; });
+  controller.waitFor(() => day.getNode().mDate.icalString == "20090101");
 
   // create event
   // Thursday of 2009-01-01 should be the selected box in the first row with default settings
   let hour = new Date().getHours(); // remember time at click
   controller.doubleClick(new elementslib.Lookup(controller.window.document, monthView +
     'anon({"anonid":"mainbox"})/anon({"anonid":"monthgrid"})/anon({"anonid":"monthgridrows"})/' +
     '[0]/{"selected":"true"}/anon({"anonid":"day-items"})'));
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
   // check that the start time is correct
   // next full hour except last hour hour of the day
   let nextHour = (hour == 23) ? hour : (hour + 1) % 24;
   let startTime = nextHour + ":00"; // next full hour
   let startTimeInput = new elementslib.Lookup(event.window.document, eventDialog +
     'id("event-grid-startdate-row")/id("event-grid-startdate-picker-box")/' +
@@ -104,17 +104,17 @@ var testMonthView = function() {
     '[0]/{"label":"' + calendar + '"}'));
 
   // save
   event.click(new elementslib.ID(event.window.document, "button-save"));
 
   // if it was created successfully, it can be opened
   controller.waitForElement(new elementslib.Lookup(controller.window.document, eventBox));
   controller.doubleClick(new elementslib.Lookup(controller.window.document, eventBox));
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
   // change title and save changes
   let titleTextBox = new elementslib.Lookup(event.window.document, eventDialog +
     'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/' +
     'anon({"anonid":"input"})');
   event.waitForElement(titleTextBox);
   event.type(titleTextBox, title2);
--- a/calendar/test/mozmill/views/testMultiweekView.js
+++ b/calendar/test/mozmill/views/testMultiweekView.js
@@ -52,25 +52,25 @@ var testMultiWeekView = function() {
   // pick day
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, miniMonth +
     'anon({"anonid":"minimonth-calendar"})/[1]/{"value":"1"}'));
 
   // verify date
   let day = new elementslib.Lookup(controller.window.document, multiWeekView +
     'anon({"anonid":"mainbox"})/anon({"anonid":"monthgrid"})/anon({"anonid":"monthgridrows"})/' +
     '[0]/{"selected":"true"}');
-  controller.waitFor(function() { return day.getNode().mDate.icalString == "20090101"; });
+  controller.waitFor(() => day.getNode().mDate.icalString == "20090101");
 
   // create event
   // Thursday of 2009-01-01 should be the selected box in the first row with default settings
   let hour = new Date().getHours(); // remember time at click
   controller.doubleClick(new elementslib.Lookup(controller.window.document, multiWeekView +
     'anon({"anonid":"mainbox"})/anon({"anonid":"monthgrid"})/anon({"anonid":"monthgridrows"})/' +
     '[0]/{"selected":"true"}/anon({"anonid":"day-items"})'));
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
   // check that the start time is correct
   // next full hour except last hour hour of the day
   let nextHour = (hour == 23) ? hour : (hour + 1) % 24;
   let startTime = nextHour + ":00";
   let startTimeInput = new elementslib.Lookup(event.window.document, eventDialog +
     'id("event-grid-startdate-row")/id("event-grid-startdate-picker-box")/' +
@@ -104,17 +104,17 @@ var testMultiWeekView = function() {
     '[0]/{"label":"' + calendar + '"}'));
 
   // save
   event.click(new elementslib.ID(event.window.document, "button-save"));
 
   // if it was created successfully, it can be opened
   controller.waitForElement(new elementslib.Lookup(controller.window.document, eventBox));
   controller.doubleClick(new elementslib.Lookup(controller.window.document, eventBox));
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
   // change title and save changes
   let titmeTextBox = new elementslib.Lookup(event.window.document, eventDialog +
     'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/' +
     'anon({"anonid":"input"})');
   event.waitForElement(titmeTextBox);
   event.type(titmeTextBox, title2);
--- a/calendar/test/mozmill/views/testTaskView.js
+++ b/calendar/test/mozmill/views/testTaskView.js
@@ -57,30 +57,30 @@ var testTaskView = function() {
   controller.keypress(new elementslib.Lookup(controller.window.document, taskView +
     'id("task-addition-box")/id("view-task-edit-field")/anon({"class":"textbox-input-box"})/' +
     'anon({"anonid":"input"})'),
     "VK_RETURN",
     {});
 
   // verify added
   let countAfter;
-  controller.waitFor(function() {
+  controller.waitFor(() => {
     countAfter = taskTreeNode.mTaskArray.length;
     return countBefore + 1 == countAfter;
   });
 
   // last added task is automatically selected so verify detail window data
   controller.assertJSProperty(new elementslib.ID(controller.window.document,
     "calendar-task-details-title"), "textContent", title);
 
   // open added task
   // doubleclick on completion checkbox is ignored as opening action, so don't click at immediate
   // left where the checkbox is located
   controller.doubleClick(new elementslib.Lookup(controller.window.document, treeChildren), 50, 0);
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let task = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
   // verify calendar
   task.waitForElement(new elementslib.Lookup(task.window.document, taskDialog +
     'id("event-grid-category-color-row")/id("event-grid-category-box")/id("item-calendar")/[0]/' +
     '{"selected":"true","label":"' + calendar + '"}'));
 
   // add description, mark needs action and add percent complete
@@ -99,17 +99,17 @@ var testTaskView = function() {
   task.type(new elementslib.Lookup(task.window.document, taskDialog +
     'id("event-grid-todo-status-row")/id("event-grid-todo-status-picker-box")/' +
     'id("percent-complete-textbox")/anon({"class":"textbox-input-box numberbox-input-box"})/' +
     'anon({"anonid":"input"})'),
     percentComplete);
 
   // save
   task.click(new elementslib.ID(task.window.document, "button-save"));
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length == 0; });
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length == 0);
 
   // verify description and status in details pane
   controller.assertValue(new elementslib.Lookup(controller.window.document, taskView +
     '{"flex":"1"}/id("calendar-task-details-container")/id("calendar-task-details-description")/' +
     'anon({"class":"textbox-input-box"})/anon({"anonid":"input"})'),
     description);
   let status = utils.getProperty("chrome://calendar/locale/calendar.properties",
     "taskDetailsStatusNeedsAction");
--- a/calendar/test/mozmill/views/testWeekView.js
+++ b/calendar/test/mozmill/views/testWeekView.js
@@ -51,24 +51,24 @@ var testWeekView = function() {
   // pick day
   controller.waitThenClick(new elementslib.Lookup(controller.window.document, miniMonth +
     'anon({"anonid":"minimonth-calendar"})/[1]/{"value":"1"}'));
 
   // verify date
   let day = new elementslib.Lookup(controller.window.document, weekView +
     'anon({"anonid":"mainbox"})/anon({"anonid":"labelbox"})/anon({"anonid":"labeldaybox"})/' +
     '{"selected":"true"}');
-  controller.waitFor(function() { return day.getNode().mDate.icalString == "20090101"; });
+  controller.waitFor(() => day.getNode().mDate.icalString == "20090101");
 
   // create event at 8 AM
   // Thursday of 2009-01-01 is 4th with default settings
   controller.doubleClick(new elementslib.Lookup(controller.window.document, weekView +
     'anon({"anonid":"mainbox"})/anon({"anonid":"scrollbox"})/anon({"anonid":"daybox"})/' +
     '[4]/anon({"anonid":"boxstack"})/anon({"anonid":"bgbox"})/[8]'), 1, 1);
-  controller.waitFor(function() { return mozmill.utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
   // check that the start time is correct
   let startTimeInput = new elementslib.Lookup(event.window.document, eventDialog +
     'id("event-grid-startdate-row")/id("event-grid-startdate-picker-box")/' +
     'id("event-starttime")/anon({"anonid":"hbox"})/anon({"anonid":"time-picker"})/' +
     'anon({"class":"timepicker-box-class"})/anon({"class":"timepicker-text-class"})/' +
     'anon({"flex":"1"})/anon({"anonid":"input"})');
@@ -96,17 +96,17 @@ var testWeekView = function() {
   event.select(new elementslib.ID(event.window.document, "item-calendar"), null, calendar);
 
   // save
   event.click(new elementslib.ID(event.window.document, "button-save"));
 
   // if it was created successfully, it can be opened
   controller.waitForElement(new elementslib.Lookup(controller.window.document, eventBox));
   controller.doubleClick(new elementslib.Lookup(controller.window.document, eventBox));
-  controller.waitFor(function() { return utils.getWindows("Calendar:EventDialog").length > 0; }, sleep);
+  controller.waitFor(() => utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
   // change title and save changes
   let titleTextBox = new elementslib.Lookup(event.window.document, eventDialog +
     'id("event-grid-title-row")/id("item-title")/anon({"class":"textbox-input-box"})/' +
     'anon({"anonid":"input"})');
   event.waitForElement(titleTextBox);
   event.type(titleTextBox, title2);
--- a/calendar/test/unit/test_alarm.js
+++ b/calendar/test/unit/test_alarm.js
@@ -55,22 +55,22 @@ function test_display_alarm() {
     // SUMMARY is not valid for ACTION:DISPLAY
     alarm.summary = "test";
     equal(alarm.summary, null);
 
     // No attendees allowed
     let attendee = cal.createAttendee();
     attendee.id = "mailto:horst";
 
-    throws(function() {
+    throws(() => {
         // DISPLAY alarm should not be able to save attendees
         alarm.addAttendee(attendee);
     }, /Alarm type AUDIO\/DISPLAY may not have attendees/);
 
-    throws(function() {
+    throws(() => {
         // DISPLAY alarm should not be able to save attachment
         alarm.addAttachment(cal.createAttachment());
     }, /Alarm type DISPLAY may not have attachments/);
 
     dump("Done\n");
 }
 
 function test_email_alarm() {
@@ -410,21 +410,21 @@ function test_immutable() {
         } catch (e) {
             equal(e.result, Components.results.NS_ERROR_OBJECT_IS_IMMUTABLE);
             continue;
         }
         do_throw("Attribute " + prop + " was writable while item was immutable");
     }
 
     // Functions
-    throws(function() {
+    throws(() => {
         alarm.setProperty("X-FOO", "changed");
     }, /Can not modify immutable data container/);
 
-    throws(function() {
+    throws(() => {
         alarm.deleteProperty("X-FOO");
     }, /Can not modify immutable data container/);
 
     ok(!alarm.getProperty("X-DATEPROP").isMutable);
 
     dump("Done\n");
 }
 
@@ -491,17 +491,17 @@ function test_clone() {
     dump("Done\n");
 }
 
 function test_serialize() {
     // most checks done by other tests, these don't fit into categories
     let alarm = cal.createAlarm();
     let srv = cal.getIcsService();
 
-    throws(function() {
+    throws(() => {
         alarm.icalComponent = srv.createIcalComponent("BARF");
     }, /0x80070057/, "Invalid Argument");
 
     function addProp(k, v) { let p = srv.createIcalProperty(k); p.value = v; comp.addProperty(p); }
     function addActionDisplay() { addProp("ACTION", "DISPLAY"); }
     function addActionEmail() { addProp("ACTION", "EMAIL"); }
     function addTrigger() { addProp("TRIGGER", "-PT15M"); }
     function addDescr() { addProp("DESCRIPTION", "TEST"); }
@@ -519,39 +519,39 @@ function test_serialize() {
     // Attachments and attendees
     comp = srv.createIcalComponent("VALARM");
     addActionEmail(); addTrigger(); addDescr();
     addAttendee(); addAttachment();
     alarm.icalComponent = comp;
     alarm.toString();
 
     // Missing action
-    throws(function() {
+    throws(() => {
         comp = srv.createIcalComponent("VALARM");
         addTrigger(); addDescr();
         alarm.icalComponent = comp;
     }, /Illegal value/, "Invalid Argument");
 
     // Missing trigger
-    throws(function() {
+    throws(() => {
         comp = srv.createIcalComponent("VALARM");
         addActionDisplay(); addDescr();
         alarm.icalComponent = comp;
     }, /Illegal value/, "Invalid Argument");
 
     // Missing duration with repeat
-    throws(function() {
+    throws(() => {
         comp = srv.createIcalComponent("VALARM");
         addActionDisplay(); addTrigger(); addDescr();
         addRepeat();
         alarm.icalComponent = comp;
     }, /Illegal value/, "Invalid Argument");
 
     // Missing repeat with duration
-    throws(function() {
+    throws(() => {
         comp = srv.createIcalComponent("VALARM");
         addActionDisplay(); addTrigger(); addDescr();
         addDuration();
         alarm.icalComponent = comp;
     }, /Illegal value/, "Invalid Argument");
 }
 
 function test_strings() {
--- a/calendar/test/unit/test_alarmservice.js
+++ b/calendar/test/unit/test_alarmservice.js
@@ -109,17 +109,17 @@ var alarmObserver = {
 };
 
 function run_test() {
     do_get_profile();
 
     add_test(() => {
         // initialization needs to be done within the first test in order for
         // the subsequent tests to run properly
-        do_calendar_startup(function() {
+        do_calendar_startup(() => {
             initializeAlarmService();
             run_next_test();
         });
     });
     add_test(test_addItems);
     add_test(test_loadCalendar);
     add_test(test_modifyItems);
 
@@ -193,21 +193,21 @@ function addTestItems(aCalendar) {
     // alarm more than 6 hours in the future should not have a timer set
     [item, alarm] = createEventWithAlarm(aCalendar, dt, dt, "PT7H");
     alarmObserver.expectResult(aCalendar, item, alarm, EXPECT_NONE);
     aCalendar.addItem(item, null);
 
     // test multiple alarms on an item
     [item, alarm] = createEventWithAlarm(aCalendar, dt, dt);
     [["-PT1H", EXPECT_FIRED], ["-PT15M", EXPECT_FIRED], ["PT1H", EXPECT_TIMER],
-     ["PT7H", EXPECT_NONE], ["P7D", EXPECT_NONE]].forEach(function([offset, expected]) {
+     ["PT7H", EXPECT_NONE], ["P7D", EXPECT_NONE]].forEach(([offset, expected]) => {
         alarm = createAlarmFromDuration(offset);
         item.addAlarm(alarm);
         alarmObserver.expectResult(aCalendar, item, alarm, expected);
-    }, this);
+    });
     aCalendar.addItem(item, null);
 
     // daily repeating event starting almost 2 full days ago. The alarms on the first 2 occurrences
     // should fire, and a timer should be set for the next occurrence only
     dt = cal.now();
     dt.hour -= 47;
     [item, alarm] = createEventWithAlarm(aCalendar, dt, dt, "-PT15M", "RRULE:FREQ=DAILY");
     alarmObserver.expectOccurrences(aCalendar, item, alarm,
@@ -325,38 +325,38 @@ function doRunTest(aOnCalendarCreated, a
     memory.id = cal.getUUID();
 
     if (aOnCalendarCreated) {
         aOnCalendarCreated.call(aOnCalendarCreated, memory);
     }
 
     calmgr.registerCalendar(memory);
 
-    alarmObserver.doOnAlarmsLoaded(memory, function() {
+    alarmObserver.doOnAlarmsLoaded(memory, () => {
         if (aOnAlarmsLoaded) {
             aOnAlarmsLoaded.call(aOnAlarmsLoaded, memory);
         }
 
         run_next_test();
     });
 }
 
 // Test the initial alarm loading of a calendar with existing data
 function test_loadCalendar() {
     doRunTest(addTestItems, alarmObserver.checkExpected.bind(alarmObserver));
 }
 
 // Test adding alarm data to a calendar already registered
 function test_addItems() {
-    doRunTest(null, function(memory) {
+    doRunTest(null, (memory) => {
         addTestItems(memory);
         alarmObserver.checkExpected();
     });
 }
 
 // Test response to modification of alarm data
 function test_modifyItems() {
-    doRunTest(null, function(memory) {
+    doRunTest(null, (memory) => {
         doModifyItemTest(memory);
         doDeleteItemTest(memory);
         doAcknowledgeTest(memory);
     });
 }
--- a/calendar/test/unit/test_attachment.js
+++ b/calendar/test/unit/test_attachment.js
@@ -92,17 +92,17 @@ function test_serialize() {
     attach.uri = Services.io.newURI("data:text/plain,", null, null);
     equal(attach.icalString, "ATTACH;FMTTYPE=x-moz/test2:data:text/plain,\r\n");
 
     attach = cal.createAttachment();
     attach.encoding = "BASE64";
     attach.uri = Services.io.newURI("data:text/plain,", null, null);
     equal(attach.icalString, "ATTACH;ENCODING=BASE64:data:text/plain,\r\n");
 
-    throws(function() {
+    throws(() => {
         attach.icalString = "X-STICKER:smiley";
     }, /Illegal value/);
 
     attach = cal.createAttachment();
     attach.uri = Services.io.newURI("data:text/plain,", null, null);
     attach.setParameter("X-PROP", "VAL");
     equal(attach.icalString, "ATTACH;X-PROP=VAL:data:text/plain,\r\n");
     attach.setParameter("X-PROP", null);
--- a/calendar/test/unit/test_attendee.js
+++ b/calendar/test/unit/test_attendee.js
@@ -34,17 +34,17 @@ function test_values() {
         let foundAttendee = event.getAttendeeById(id);
         equal(foundAttendee, a);
     }
     function testImmutability(a, properties) {
          ok(!a.isMutable);
         // Check if setting a property throws. It should.
         for (let i = 0; i < properties.length; i++) {
             let old = a[properties[i]];
-            throws(function() {
+            throws(() => {
                 a[properties[i]] = old + 1;
             }, /Can not modify immutable data container/);
 
             equal(a[properties[i]], old);
         }
     }
 
     // Create Attendee
@@ -107,17 +107,17 @@ function test_values() {
     ok(a4.isOrganizer);
     a3.isOrganizer = false;
     ok(a4.isOrganizer);
 }
 
 function test_serialize() {
     let a = cal.createAttendee();
 
-    throws(function() {
+    throws(() => {
         // eslint-disable-next-line no-unused-expressions
         a.icalProperty;
     }, /Component not initialized/);
 
     a.id = "horst";
     a.commonName = "Horst";
     a.rsvp = "TRUE";
 
@@ -150,17 +150,17 @@ function test_serialize() {
     equal(prop.getParameter("PARTSTAT"), "DECLINED");
     equal(prop.getParameter("CUTYPE"), "RESOURCE");
     equal(prop.getParameter("X-NAME"), "X-VALUE");
 }
 
 function test_properties() {
     let a = cal.createAttendee();
 
-    throws(function() {
+    throws(() => {
         // eslint-disable-next-line no-unused-expressions
         a.icalProperty;
     }, /Component not initialized/);
 
     a.id = "horst";
     a.commonName = "Horst";
     a.rsvp = "TRUE";
 
--- a/calendar/test/unit/test_bug350845.js
+++ b/calendar/test/unit/test_bug350845.js
@@ -11,27 +11,27 @@ function run_test() {
 
     // Test getters for imported event
     equal(event.getProperty("X-FOO"), "QUUX");
     ok(event.hasProperty("X-FOO"));
     equal(event.getPropertyParameter("X-FOO", "X-BAR"), "BAZ");
     ok(event.hasPropertyParameter("X-FOO", "X-BAR"));
 
     // Test setters
-    throws(function() {
+    throws(() => {
       event.setPropertyParameter("X-UNKNOWN", "UNKNOWN", "VALUE");
     }, /Property X-UNKNOWN not set/);
 
     // More setters
     event.setPropertyParameter("X-FOO", "X-BAR", "FNORD");
     equal(event.getPropertyParameter("X-FOO", "X-BAR"), "FNORD");
     notEqual(event.icalString.match(/^X-FOO;X-BAR=FNORD:QUUX$/m), null);
 
     // Enumerator
-    throws(function() {
+    throws(() => {
       event.getParameterEnumerator("X-UNKNOWN");
     }, /Property X-UNKNOWN not set/);
 
     // More enumerator
     let enume = event.getParameterEnumerator("X-FOO");
     ok(enume.hasMoreElements());
     let xbar = enume.getNext().QueryInterface(Components.interfaces.nsIProperty);
     equal(xbar.name, "X-BAR");
--- a/calendar/test/unit/test_deleted_items.js
+++ b/calendar/test/unit/test_deleted_items.js
@@ -7,17 +7,17 @@ Components.utils.import("resource://gre/
 function run_test() {
     do_calendar_startup(run_next_test);
 }
 
 function check_delmgr_call(aFunc) {
     const mISSC = Components.interfaces.mozIStorageStatementCallback;
     let delmgr = Components.classes["@mozilla.org/calendar/deleted-items-manager;1"]
                            .getService(Components.interfaces.calIDeletedItems);
-    return new Promise(function(resolve, reject) {
+    return new Promise((resolve, reject) => {
         delmgr.wrappedJSObject.completedNotifier.handleCompletion = (aReason) => {
             if (aReason == mISSC.REASON_FINISHED) {
                 resolve();
             } else {
                 reject(aReason);
             }
         };
         aFunc();
--- a/calendar/test/unit/test_freebusy.js
+++ b/calendar/test/unit/test_freebusy.js
@@ -51,20 +51,20 @@ function test_period() {
     period.icalString = "20120101T010105/PT1S";
     equal(period.start.icalString, "20120101T010105");
     equal(period.end.icalString, "20120101T010106");
     equal(period.duration.icalString, "PT1S");
 
     period.makeImmutable();
     if (!Preferences.get("calendar.icaljs", false)) {
         // ical.js doesn't support immutability yet
-        throws(function() {
+        throws(() => {
             period.start = cal.createDateTime("20120202T020202");
         }, /0x80460002/, "Object is Immutable");
-        throws(function() {
+        throws(() => {
             period.end = cal.createDateTime("20120202T020202");
         }, /0x80460002/, "Object is Immutable");
     }
 
     let copy = period.clone();
     equal(copy.start.icalString, "20120101T010105");
     equal(copy.end.icalString, "20120101T010106");
     equal(copy.duration.icalString, "PT1S");
--- a/calendar/test/unit/test_gdata_provider.js
+++ b/calendar/test/unit/test_gdata_provider.js
@@ -168,17 +168,17 @@ GDataServer.prototype = {
                     { "type": "eventChange", "method": "email" },
                     { "type": "eventCancellation", "method": "email" }
                 ]
             }
         };
     },
 
     waitForLoad: function(aCalendar) {
-        return new Promise(function(resolve, reject) {
+        return new Promise((resolve, reject) => {
             let observer = cal.createAdapter(Components.interfaces.calIObserver, {
                 onLoad: function() {
                     let uncached = aCalendar.wrappedJSObject.mUncachedCalendar.wrappedJSObject;
                     aCalendar.removeObserver(observer);
 
                     if (Components.isSuccessCode(uncached._lastStatus)) {
                         resolve(aCalendar);
                     } else {
@@ -196,17 +196,17 @@ GDataServer.prototype = {
                   (this.calendarId ? "&calendar=" + encodeURIComponent(this.calendarId) : "") +
                   (this.tasksId ? "&tasks=" + encodeURIComponent(this.tasksId) : "");
         let calmgr = cal.getCalendarManager();
         let client = calmgr.createCalendar("gdata", Services.io.newURI(uri, null, null));
         let uclient = client.wrappedJSObject;
         client.name = "xpcshell";
 
         // Make sure we catch the last error message in case sync fails
-        monkeyPatch(uclient, "replayChangesOn", function(protofunc, aListener) {
+        monkeyPatch(uclient, "replayChangesOn", (protofunc, aListener) => {
             protofunc({
               onResult: function(op, detail) {
                 uclient._lastStatus = op.status;
                 uclient._lastMessage = detail;
                 aListener.onResult(op, detail);
               }
            });
         });
@@ -512,17 +512,17 @@ function run_test() {
 
 add_task(function* test_migrate_cache() {
     let uriString = "googleapi://xpcshell/?calendar=xpcshell%40example.com";
     let uri = Services.io.newURI(uriString, null, null);
     let client = cal.getCalendarManager().createCalendar("gdata", uri);
     let unwrapped = client.wrappedJSObject;
     let migrateStorageCache = unwrapped.migrateStorageCache.bind(unwrapped);
 
-    monkeyPatch(unwrapped, "resetSync", function(protofunc) {
+    monkeyPatch(unwrapped, "resetSync", (protofunc) => {
         return Promise.resolve();
     });
 
     // No version, should not reset
     equal(yield migrateStorageCache(), false);
     equal(client.getProperty("cache.version"), 3);
 
     // Check migrate 1 -> 2
--- a/calendar/test/unit/test_ics.js
+++ b/calendar/test/unit/test_ics.js
@@ -213,12 +213,12 @@ function test_duration() {
     e.endDate = null;
     equal(e.duration.icalString, "PT0S");
 }
 
 function test_serialize() {
     let e = cal.createEvent();
     let prop = cal.getIcsService().createIcalComponent("VTODO");
 
-    throws(function() {
+    throws(() => {
         e.icalComponent = prop;
     }, /Illegal value/);
 }
--- a/calendar/test/unit/test_items.js
+++ b/calendar/test/unit/test_items.js
@@ -214,26 +214,26 @@ function test_immutable() {
 
     // call again, should not throw
     e.makeImmutable();
 
     ok(!e.alarmLastAck.isMutable);
     ok(!org.isMutable);
     ok(!alarm.isMutable);
 
-    throws(function() {
+    throws(() => {
         e.alarmLastAck = cal.createDateTime();
     }, /Can not modify immutable data container/);
-    throws(function() {
+    throws(() => {
         e.calendar = null;
     }, /Can not modify immutable data container/);
-    throws(function() {
+    throws(() => {
         e.parentItem = null;
     }, /Can not modify immutable data container/);
-    throws(function() {
+    throws(() => {
         e.setCategories(3, ["d", "e", "f"]);
     }, /Can not modify immutable data container/);
 
     let e2 = e.clone();
     e2.organizer.id = "two";
 
     equal(org.id, "one");
     equal(e2.organizer.id, "two");
--- a/calendar/test/unit/test_relation.js
+++ b/calendar/test/unit/test_relation.js
@@ -117,12 +117,12 @@ function test_icalprop() {
     let rel2 = rel.clone();
     rel.icalProperty = prop;
 
     notEqual(rel.icalString, rel2.icalString);
 
     rel.deleteParameter("X-PROP");
     equal(rel.icalProperty.getParameter("X-PROP"), null);
 
-    throws(function() {
+    throws(() => {
         rel.icalString = "X-UNKNOWN:value";
     }, /Illegal value/);
 }
--- a/calendar/test/unit/test_storage.js
+++ b/calendar/test/unit/test_storage.js
@@ -19,17 +19,17 @@ function testAttachRoundtrip() {
                "EXDATE:20120301T010101Z",
                "END:VEVENT"].join("\r\n");
 
     let storageItem = createEventFromIcalString(str);
 
     do_test_pending();
     storage.addItem(storageItem, {
         onOperationComplete: function(c, s, o, i, addedItem) {
-            do_execute_soon(function() {
+            do_execute_soon(() => {
                 // Make sure the cache is cleared, otherwise we'll get the cached item.
                 delete storage.wrappedJSObject.mItemCache[addedItem.id];
                 storage.getItem(addedItem.id, retrieveItem);
             });
         }
     });
 
     let retrieveItem = {
--- a/calendar/test/unit/test_webcal.js
+++ b/calendar/test/unit/test_webcal.js
@@ -31,13 +31,13 @@ function check_webcal_uri(aUri) {
 
     let channel = Services.io.newChannelFromURI2(uri,
                                                  null,
                                                  Services.scriptSecurityManager.getSystemPrincipal(),
                                                  null,
                                                  Components.interfaces.nsILoadInfo.SEC_NORMAL,
                                                  Components.interfaces.nsIContentPolicy.TYPE_OTHER);
 
-    NetUtil.asyncFetch(channel, function(data, status, request) {
+    NetUtil.asyncFetch(channel, (data, status, request) => {
         ok(Components.isSuccessCode(status));
         run_next_test();
     });
 }