Bug 1321274 - Remove usage of javascript String generics. r?Fallen draft
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 30 Nov 2016 17:55:47 +0100
changeset 21191 cbefa86ae5680e66ecf3f10dac20d7f6ea34aaa2
parent 21190 246f134d028e0237b197513dab8d0bec4362828e
child 21192 64fabd2e33871a992fb70cc7f6decaafa9a19f5f
push id75
push userarchaeopteryx@coole-files.de
push dateWed, 30 Nov 2016 16:57:01 +0000
reviewersFallen
bugs1321274
Bug 1321274 - Remove usage of javascript String generics. r?Fallen MozReview-Commit-ID: 8kHT5zyvug4
calendar/base/content/dialogs/calendar-event-dialog-timezone.js
calendar/base/content/preferences/general.js
calendar/providers/wcap/calWcapSession.js
--- a/calendar/base/content/dialogs/calendar-event-dialog-timezone.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-timezone.js
@@ -37,17 +37,17 @@ function onLoad() {
         let timezone = tzProvider.getTimezone(enumerator.getNext());
         if (timezone && !timezone.isFloating && !timezone.isUTC) {
             let displayName = timezone.displayName;
             displayNames.push(displayName);
             tzids[displayName] = timezone.tzid;
         }
     }
     // the display names need to be sorted
-    displayNames.sort(String.localeCompare);
+    displayNames.sort((a, b) => a.localeCompare(b));
     for (let i = 0; i < displayNames.length; ++i) {
         let displayName = displayNames[i];
         addMenuItem(tzMenuPopup, displayName, tzids[displayName]);
     }
 
     let index = findTimezone(window.time.timezone);
     if (index < 0) {
         index = findTimezone(calendarDefaultTimezone());
--- a/calendar/base/content/preferences/general.js
+++ b/calendar/base/content/preferences/general.js
@@ -44,17 +44,17 @@ var gCalendarGeneralPane = {
             let timezone = tzService.getTimezone(enumerator.getNext());
             if (timezone && !timezone.isFloating && !timezone.isUTC) {
                 let displayName = timezone.displayName;
                 displayNames.push(displayName);
                 tzids[displayName] = timezone.tzid;
             }
         }
         // the display names need to be sorted
-        displayNames.sort(String.localeCompare);
+        displayNames.sort((a, b) => a.localeCompare(b));
         for (let displayName of displayNames) {
             addMenuItem(tzMenuPopup, displayName, tzids[displayName]);
         }
 
         let prefValue = document.getElementById("calendar-timezone-local").value;
         if (!prefValue) {
             prefValue = calendarDefaultTimezone().tzid;
         }
--- a/calendar/providers/wcap/calWcapSession.js
+++ b/calendar/providers/wcap/calWcapSession.js
@@ -834,17 +834,17 @@ calWcapSession.prototype = {
         return alarmStart;
     },
 
     getDefaultAlarmEmails: function(out_count) {
         let ret = [];
         let alarmEmails = this.getUserPreferences("X-NSCP-WCAP-PREF-ceDefaultAlarmEmail");
         if (alarmEmails.length > 0 && alarmEmails[0].length > 0) {
             for (let email of alarmEmails) {
-                ret = ret.concat(email.split(/[;,]/).map(String.trim));
+                ret = ret.concat(email.split(/[;,]/).map(email => email.trim()));
             }
         }
         out_count.value = ret.length;
         return ret;
     },
 
     // calICalendarSearchProvider:
     searchForCalendars: function(searchString, hints, maxResults, listener) {