Bug 1110166 - Port bug 1102219 - Rename String.prototype.contains to String.prototype.includes: calendar. r=Fallen
authorSebastian Hengst <archaeopteryx@coole-files.de>
Fri, 01 May 2015 21:58:10 +0200
changeset 22559 1f6cefb73596947b175691ec0baeb239fdba6f52
parent 22558 1cf79e3da57ab8d9b835e5d9201210eb984563ac
child 22560 0dd5e1453b7f62fe9ce97c0a8a8543ed9e97b444
push id1420
push usermbanner@mozilla.com
push dateMon, 29 Jun 2015 20:47:24 +0000
treeherdercomm-beta@b3db00bb24e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFallen
bugs1110166, 1102219
Bug 1110166 - Port bug 1102219 - Rename String.prototype.contains to String.prototype.includes: calendar. r=Fallen
calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
calendar/base/modules/calExtract.jsm
calendar/providers/caldav/calDavCalendar.js
calendar/providers/gdata/content/gdata-list-tree.xml
--- a/calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
+++ b/calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
@@ -1047,17 +1047,17 @@
                           : '"' + aMsgIAddressObject.name + '"'
                          ) + ' <' + aMsgIAddressObject.email + '>';
               } else {
                   return aMsgIAddressObject.toString();
               }
           }
 
           let arrowLength = 1;
-          if (element.value.contains(",") || element.value.match(/^[^"].*[<>@,].*[^"] <.+@.+>$/)) {
+          if (element.value.includes(",") || element.value.match(/^[^"].*[<>@,].*[^"] <.+@.+>$/)) {
               let strippedAddresses = element.value.replace(/.* >> /, "");
               let addresses = MailServices.headerParser.makeFromDisplayAddress(strippedAddresses);
               element.value = parseHeaderValue(addresses[0]);
 
               // the following code is needed to split attendees, if the user enters a comma
               // separated list of attendees without using autocomplete functionality
               let insertAfterItem = this.getListItem(this.getRowByInputElement(element));
               for (let key in addresses) {
--- a/calendar/base/modules/calExtract.jsm
+++ b/calendar/base/modules/calExtract.jsm
@@ -716,18 +716,18 @@ Extractor.prototype = {
     markSelected: function markSelected(sel, title) {
         if (sel.rangeCount > 0) {
             // mark the ones to not use
             for (let i = 0; i < sel.rangeCount; i++) {
                 cal.LOG("[calExtract] Selection " + i + " is " + sel);
                 for (let j = 0; j < this.collected.length; j++) {
                     let selection = sel.getRangeAt(i).toString();
 
-                    if (!selection.contains(this.collected[j].str) &&
-                        !title.contains(this.collected[j].str) &&
+                    if (!selection.includes(this.collected[j].str) &&
+                        !title.includes(this.collected[j].str) &&
                         this.collected[j].start != null) { // always keep email date, needed for tasks
                         cal.LOG("[calExtract] Marking " + JSON.stringify(this.collected[j]) + " as notadatetime");
                         this.collected[j].relation = "notadatetime";
                     }
                 }
             }
         }
     },
--- a/calendar/providers/caldav/calDavCalendar.js
+++ b/calendar/providers/caldav/calDavCalendar.js
@@ -333,17 +333,17 @@ calDavCalendar.prototype = {
     },
 
     sendHttpRequest: function(aUri, aUploadData, aContentType, aExisting, aSetupChannelFunc, aFailureFunc, aUseStreamLoader=true) {
         function oauthCheck(nextMethod, loaderOrRequest /* either the nsIStreamLoader or nsIRequestObserver parameters */) {
             let request = (loaderOrRequest.request || loaderOrRequest).QueryInterface(Components.interfaces.nsIHttpChannel);
             let error = false;
             try {
                 let wwwauth = request.getResponseHeader("WWW-Authenticate");
-                if (wwwauth.startsWith("Bearer") && wwwauth.contains("error=")) {
+                if (wwwauth.startsWith("Bearer") && wwwauth.includes("error=")) {
                     // An OAuth error occurred, we need to reauthenticate.
                     error = true;
                 }
             } catch (e) {
                 // This happens in case the response header is missing, thats fine.
             }
 
             if (self.oauth && error) {
--- a/calendar/providers/gdata/content/gdata-list-tree.xml
+++ b/calendar/providers/gdata/content/gdata-list-tree.xml
@@ -178,19 +178,19 @@
           return true;
         ]]></body>
       </method>
 
       <method name="getParentIndex">
         <parameter name="aRow"/>
         <body><![CDATA[
           let calendar = this.getCalendar(aRow);
-          if (calendar.uri.path.contains("?calendar")) {
+          if (calendar.uri.path.includes("?calendar")) {
               return this.mCalendarHeaderIndex;
-          } else if (calendar.uri.path.contains("?tasks")) {
+          } else if (calendar.uri.path.includes("?tasks")) {
               return this.mTasksHeaderIndex;
           } else {
               return -1;
           }
         ]]></body>
       </method>
 
       <method name="hasNextSibling">