Bug 1561750 - Convert three 'foo.indexOf(...) >' to 'foo.includes(...)'. r=jorgk DONTBUILD
authorIan Neal <iann_cvs@blueyonder.co.uk>
Wed, 26 Jun 2019 15:05:00 +0200
changeset 35967 ca15c222cd1e74e1e1115dc2b346859b239f8f50
parent 35966 f046db4f15a11591875a9ec4b534d5379585a658
child 35968 514320eaad420d55c27d60b910cdd75a6073a750
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersjorgk
bugs1561750
Bug 1561750 - Convert three 'foo.indexOf(...) >' to 'foo.includes(...)'. r=jorgk DONTBUILD
mail/base/content/msgMail3PaneWindow.js
mail/components/extensions/parent/ext-menus.js
--- a/mail/base/content/msgMail3PaneWindow.js
+++ b/mail/base/content/msgMail3PaneWindow.js
@@ -194,21 +194,21 @@ var folderListener = {
       if (folder) {
         var imapFolder = folder.QueryInterface(Ci.nsIMsgImapMailFolder);
         if (imapFolder) {
           var hdrParser = imapFolder.hdrParser;
           if (hdrParser) {
             var msgHdr = hdrParser.GetNewMsgHdr();
             if (msgHdr) {
               var hdrs = hdrParser.headers;
-              if (hdrs && hdrs.indexOf("X-attachment-size:") > 0) {
+              if (hdrs && hdrs.includes("X-attachment-size:")) {
                 msgHdr.OrFlags(Ci.nsMsgMessageFlags
                                  .Attachment);
               }
-              if (hdrs && hdrs.indexOf("X-image-size:") > 0) {
+              if (hdrs && hdrs.includes("X-image-size:")) {
                 msgHdr.setStringProperty("imageSize", "1");
               }
             }
           }
         }
       }
     } else if (event == "JunkStatusChanged") {
       HandleJunkStatusChanged(folder);
--- a/mail/components/extensions/parent/ext-menus.js
+++ b/mail/components/extensions/parent/ext-menus.js
@@ -264,17 +264,17 @@ var gMenuBuilder = {
           } else {
             accessKey = nextChar;
           }
         }
         return nextChar;
       });
       element.setAttribute("accesskey", accessKey || "");
 
-      if (contextData.isTextSelected && label.indexOf("%s") > -1) {
+      if (contextData.isTextSelected && label.includes("%s")) {
         let selection = contextData.selectionText.trim();
         // The rendering engine will truncate the title if it's longer than 64 characters.
         // But if it makes sense let's try truncate selection text only, to handle cases like
         // 'look up "%s" in MyDictionary' more elegantly.
 
         let codePointsToRemove = 0;
 
         let selectionArray = Array.from(selection);