Bug 1577835 - Fix 'function and comments' formatting in mailnews/. r=mkmelin
authorPaul Morris <paul@thunderbird.net>
Sat, 31 Aug 2019 08:16:12 -0400
changeset 35716 dfc10500bb00606a7ffb6dfc2a7df3f69523ec82
parent 35715 d61a07ada51d6fb7fa88083b89615542116197ad
child 35717 8177b85d18db77c4787461cd6db9575ef9935aea
push id2486
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:24:43 +0000
treeherdercomm-beta@1b30a9a6e7f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs1577835
Bug 1577835 - Fix 'function and comments' formatting in mailnews/. r=mkmelin
mailnews/base/search/content/FilterEditor.js
mailnews/base/test/unit/test_nsMsgMailSession_Alerts.js
mailnews/compose/test/unit/test_bug155172.js
mailnews/compose/test/unit/test_bug235432.js
mailnews/compose/test/unit/test_bug474774.js
mailnews/compose/test/unit/test_sendMailAddressIDN.js
mailnews/compose/test/unit/test_sendMessageLater.js
mailnews/compose/test/unit/test_sendMessageLater2.js
mailnews/compose/test/unit/test_sendMessageLater3.js
mailnews/compose/test/unit/test_smtpPasswordFailure1.js
mailnews/compose/test/unit/test_smtpPasswordFailure2.js
mailnews/compose/test/unit/test_smtpPasswordFailure3.js
mailnews/extensions/smime/content/msgCompSecurityInfo.js
mailnews/extensions/smime/content/msgReadSecurityInfo.js
mailnews/imap/test/unit/test_imapCopyTimeout.js
mailnews/imap/test/unit/test_imapPasswordFailure.js
mailnews/imap/test/unit/test_offlineStoreLocking.js
mailnews/imap/test/unit/test_starttlsFailure.js
--- a/mailnews/base/search/content/FilterEditor.js
+++ b/mailnews/base/search/content/FilterEditor.js
@@ -793,19 +793,21 @@ function SetBusyCursor(window, enable) {
   // setCursor method
   if ("setCursor" in window) {
     if (enable) {
       window.setCursor("wait");
     } else {
       window.setCursor("auto");
     }
   }
-} // suite/components/helpviewer/content/contextHelp.js
+}
 
-/* globals openHelp */ function doHelpButton() {
+/* globals openHelp */
+// suite/components/helpviewer/content/contextHelp.js
+function doHelpButton() {
   openHelp("mail-filters");
 }
 
 function getCustomActions() {
   if (!gCustomActions) {
     gCustomActions = [];
     let customActionsEnum = MailServices.filters.getCustomActions();
     while (customActionsEnum.hasMoreElements()) {
--- a/mailnews/base/test/unit/test_nsMsgMailSession_Alerts.js
+++ b/mailnews/base/test/unit/test_nsMsgMailSession_Alerts.js
@@ -12,19 +12,21 @@ var { MailServices } = ChromeUtils.impor
 load("../../../resources/alertTestUtils.js");
 
 var gDialogTitle = null;
 var gText = null;
 
 function reset() {
   gDialogTitle = null;
   gText = null;
-} // Used in alertTestUtils.
+}
 
-/* exported alert */ function alert(aDialogTitle, aText) {
+/* exported alert */
+// Used in alertTestUtils.
+function alert(aDialogTitle, aText) {
   Assert.equal(gDialogTitle, null);
   Assert.equal(gText, null);
 
   gDialogTitle = aDialogTitle;
   gText = aText;
 }
 
 var msgWindow = {
--- a/mailnews/compose/test/unit/test_bug155172.js
+++ b/mailnews/compose/test/unit/test_bug155172.js
@@ -7,19 +7,21 @@
 /* import-globals-from ../../../test/resources/passwordStorage.js */
 load("../../../resources/alertTestUtils.js");
 load("../../../resources/passwordStorage.js");
 
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 
-var gNewPassword = null; // for alertTestUtils.js
+var gNewPassword = null;
 
-/* exported confirmEx, promptPasswordPS */ function confirmEx(
+/* exported confirmEx, promptPasswordPS */
+// for alertTestUtils.js
+function confirmEx(
   aDialogTitle,
   aText,
   aButtonFlags,
   aButton0Title,
   aButton1Title,
   aButton2Title,
   aCheckMsg,
   aCheckState
--- a/mailnews/compose/test/unit/test_bug235432.js
+++ b/mailnews/compose/test/unit/test_bug235432.js
@@ -93,19 +93,21 @@ function createExpectedTemporaryFile() {
   registerCleanupFunction(function() {
     dummyFile.remove(false);
   });
 
   let expectedFile = createTemporaryFile();
   expectedFile.remove(false);
 
   return expectedFile;
-} // for head_compose.js
+}
 
-/* exported OnStopCopy */ function OnStopCopy(aStatus) {
+/* exported OnStopCopy */
+// for head_compose.js
+function OnStopCopy(aStatus) {
   msgSend.abort();
 
   Assert.ok(!expectedTemporaryFile.exists());
 
   do_test_finished();
 }
 
 function run_test() {
--- a/mailnews/compose/test/unit/test_bug474774.js
+++ b/mailnews/compose/test/unit/test_bug474774.js
@@ -87,19 +87,21 @@ msll.prototype = {
 
       var thread = gThreadManager.currentThread;
       while (thread.hasPendingEvents()) {
         thread.processNextEvent(true);
       }
     }
     do_test_finished();
   },
-}; // for head_compose.js
+};
 
-/* exported OnStopCopy */ function OnStopCopy(aStatus) {
+/* exported OnStopCopy */
+// for head_compose.js
+function OnStopCopy(aStatus) {
   do_test_finished();
 
   try {
     Assert.equal(aStatus, 0);
 
     // Check this is false before we start sending
     Assert.equal(msgSendLater.sendingMessages, false);
 
--- a/mailnews/compose/test/unit/test_sendMailAddressIDN.js
+++ b/mailnews/compose/test/unit/test_sendMailAddressIDN.js
@@ -14,19 +14,21 @@ var originalData;
 var expectedAlertMessage;
 
 var kSender = "from@foo.invalid";
 var kToASCII = "to@foo.invalid";
 var kToValid = "to@v\u00E4lid.foo.invalid";
 var kToValidACE = "to@xn--vlid-loa.foo.invalid";
 var kToInvalid = "b\u00F8rken.to@invalid.foo.invalid";
 var kToInvalidWithoutDomain = "b\u00F8rken.to";
-var NS_ERROR_BUT_DONT_SHOW_ALERT = 0x805530ef; // for alertTestUtils.js
+var NS_ERROR_BUT_DONT_SHOW_ALERT = 0x805530ef;
 
-/* exported alert */ function alert(aDialogText, aText) {
+/* exported alert */
+// for alertTestUtils.js
+function alert(aDialogText, aText) {
   // ignore without domain situation (this is crash test)
   if (test == kToInvalidWithoutDomain) {
     return;
   }
 
   // we should only get here for the kToInvalid test case
   Assert.equal(test, kToInvalid);
   Assert.equal(aText, expectedAlertMessage);
--- a/mailnews/compose/test/unit/test_sendMessageLater.js
+++ b/mailnews/compose/test/unit/test_sendMessageLater.js
@@ -95,19 +95,21 @@ msll.prototype = {
       server.stop();
 
       var thread = gThreadManager.currentThread;
       while (thread.hasPendingEvents()) {
         thread.processNextEvent(true);
       }
     }
   },
-}; // for head_compose.js
+};
 
-/* exported OnStopCopy */ function OnStopCopy(aStatus) {
+/* exported OnStopCopy */
+// for head_compose.js
+function OnStopCopy(aStatus) {
   dump("OnStopCopy()\n");
 
   try {
     Assert.equal(aStatus, 0);
 
     // Check this is false before we start sending
     Assert.equal(msgSendLater.sendingMessages, false);
 
--- a/mailnews/compose/test/unit/test_sendMessageLater2.js
+++ b/mailnews/compose/test/unit/test_sendMessageLater2.js
@@ -114,19 +114,24 @@ msll.prototype = {
     }
     // The extra timeout here is to work around an issue where sometimes
     // the sendUnsentMessages is completely synchronous up until onStopSending
     // and sometimes it isn't. This protects us for the synchronous case to
     // allow the sendUnsentMessages function to complete and exit before we
     // call async_driver.
     do_timeout(0, async_driver);
   },
-}; // for head_compose.js // This function is used to find out when the copying of the message to the // unsent message folder is completed, and hence can fire off the actual // sending of the message.
+};
 
-/* exported OnStopCopy */ function OnStopCopy(aStatus) {
+/* exported OnStopCopy */
+// for head_compose.js
+// This function is used to find out when the copying of the message to the
+// unsent message folder is completed, and hence can fire off the actual
+// sending of the message.
+function OnStopCopy(aStatus) {
   Assert.equal(aStatus, 0);
 
   // Check this is false before we start sending
   Assert.equal(msgSendLater.sendingMessages, false);
 
   // Check that the send later service thinks we have messages to send.
   Assert.equal(msgSendLater.hasUnsentMessages(identity), true);
 
--- a/mailnews/compose/test/unit/test_sendMessageLater3.js
+++ b/mailnews/compose/test/unit/test_sendMessageLater3.js
@@ -19,19 +19,21 @@ var originalData;
 var identity = null;
 var testFile = do_get_file("data/429891_testcase.eml");
 
 var kSender = "from@foo.invalid";
 var kTo = "to@foo.invalid";
 
 var msgSendLater = Cc["@mozilla.org/messengercompose/sendlater;1"].getService(
   Ci.nsIMsgSendLater
-); // for alertTestUtils.js
+);
 
-/* exported alert */ function alert(aDialogTitle, aText) {
+/* exported alert */
+// for alertTestUtils.js
+function alert(aDialogTitle, aText) {
   dump("Hiding Alert {\n" + aText + "\n} End Alert\n");
 }
 
 // This listener handles the post-sending of the actual message and checks the
 // sequence and ensures the data is correct.
 function msll() {}
 
 msll.prototype = {
@@ -68,19 +70,21 @@ msll.prototype = {
     Assert.equal(this._initialTotal, 1);
     Assert.equal(this._errorRaised, true);
     Assert.equal(msgSendLater.sendingMessages, false);
     // Check that the send later service still thinks we have messages to send.
     Assert.equal(msgSendLater.hasUnsentMessages(identity), true);
 
     do_test_finished();
   },
-}; // for head_compose.js
+};
 
-/* exported OnStopCopy */ function OnStopCopy(aStatus) {
+/* exported OnStopCopy */
+// for head_compose.js
+function OnStopCopy(aStatus) {
   Assert.equal(aStatus, 0);
 
   // Check this is false before we start sending
   Assert.equal(msgSendLater.sendingMessages, false);
 
   let folder = msgSendLater.getUnsentMessagesFolder(identity);
 
   // Check that the send later service thinks we have messages to send.
--- a/mailnews/compose/test/unit/test_smtpPasswordFailure1.js
+++ b/mailnews/compose/test/unit/test_smtpPasswordFailure1.js
@@ -25,19 +25,21 @@ var attempt = 0;
 
 var kIdentityMail = "identity@foo.invalid";
 var kSender = "from@foo.invalid";
 var kTo = "to@foo.invalid";
 var kUsername = "testsmtp";
 // Login information needs to match the login information stored in the signons
 // json file.
 var kInvalidPassword = "smtptest";
-var kValidPassword = "smtptest1"; // for alertTestUtils.js
+var kValidPassword = "smtptest1";
 
-/* exported alert, confirmEx */ function alert(aDialogText, aText) {
+/* exported alert, confirmEx */
+// for alertTestUtils.js
+function alert(aDialogText, aText) {
   // The first few attempts may prompt about the password problem, the last
   // attempt shouldn't.
   Assert.ok(attempt < 4);
 
   // Log the fact we've got an alert, but we don't need to test anything here.
   dump("Alert Title: " + aDialogText + "\nAlert Text: " + aText + "\n");
 }
 
--- a/mailnews/compose/test/unit/test_smtpPasswordFailure2.js
+++ b/mailnews/compose/test/unit/test_smtpPasswordFailure2.js
@@ -25,22 +25,21 @@ var attempt = 0;
 
 var kIdentityMail = "identity@foo.invalid";
 var kSender = "from@foo.invalid";
 var kTo = "to@foo.invalid";
 var kUsername = "testsmtp";
 // Password needs to match the login information stored in the signons json
 // file.
 var kInvalidPassword = "smtptest";
-var kValidPassword = "smtptest1"; // for alertTestUtils.js
+var kValidPassword = "smtptest1";
 
-/* exported alert, confirmEx, promptPasswordPS */ function alert(
-  aDialogText,
-  aText
-) {
+/* exported alert, confirmEx, promptPasswordPS */
+// for alertTestUtils.js
+function alert(aDialogText, aText) {
   // The first few attempts may prompt about the password problem, the last
   // attempt shouldn't.
   Assert.ok(attempt < 4);
 
   // Log the fact we've got an alert, but we don't need to test anything here.
   dump("Alert Title: " + aDialogText + "\nAlert Text: " + aText + "\n");
 }
 
--- a/mailnews/compose/test/unit/test_smtpPasswordFailure3.js
+++ b/mailnews/compose/test/unit/test_smtpPasswordFailure3.js
@@ -22,22 +22,21 @@ var server;
 var attempt = 0;
 
 var kIdentityMail = "identity@foo.invalid";
 var kSender = "from@foo.invalid";
 var kTo = "to@foo.invalid";
 var kUsername = "testsmtp";
 // Password needs to match the login information stored in the signons json
 // file.
-var kValidPassword = "smtptest1"; // for alertTestUtils.js
+var kValidPassword = "smtptest1";
 
-/* exported alert, confirmEx, promptPasswordPS */ function alert(
-  aDialogText,
-  aText
-) {
+/* exported alert, confirmEx, promptPasswordPS */
+// for alertTestUtils.js
+function alert(aDialogText, aText) {
   // The first few attempts may prompt about the password problem, the last
   // attempt shouldn't.
   Assert.ok(attempt < 4);
 
   // Log the fact we've got an alert, but we don't need to test anything here.
   dump("Alert Title: " + aDialogText + "\nAlert Text: " + aText + "\n");
 }
 
--- a/mailnews/extensions/smime/content/msgCompSecurityInfo.js
+++ b/mailnews/extensions/smime/content/msgCompSecurityInfo.js
@@ -293,19 +293,21 @@ function viewCertHelper(parent, cert) {
 function certForRow(aRowIndex) {
   return gCerts.value[aRowIndex];
 }
 
 function viewSelectedCert() {
   if (!gViewButton.disabled) {
     viewCertHelper(window, certForRow(gListBox.selectedIndex));
   }
-} // Suite only.
+}
 
-/* globals openHelp */ function doHelpButton() {
+/* globals openHelp */
+// Suite only.
+function doHelpButton() {
   openHelp(
     "compose_security",
     "chrome://communicator/locale/help/suitehelp.rdf"
   );
 }
 
 function createCell(label) {
   var cell = document.createXULElement("listcell");
--- a/mailnews/extensions/smime/content/msgReadSecurityInfo.js
+++ b/mailnews/extensions/smime/content/msgReadSecurityInfo.js
@@ -228,13 +228,15 @@ function viewSignatureCert() {
     viewCertHelper(window, gSignerCert);
   }
 }
 
 function viewEncryptionCert() {
   if (gEncryptionCert) {
     viewCertHelper(window, gEncryptionCert);
   }
-} // Suite only.
+}
 
-/* globals openHelp */ function doHelpButton() {
+/* globals openHelp */
+// Suite only.
+function doHelpButton() {
   openHelp("received_security");
 }
--- a/mailnews/imap/test/unit/test_imapCopyTimeout.js
+++ b/mailnews/imap/test/unit/test_imapCopyTimeout.js
@@ -22,19 +22,21 @@ load("../../../resources/messageGenerato
 // Globals
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 
 setupIMAPPump();
 
 var gGotAlert = false;
-var gGotMsgAdded = false; // to alertTestUtils.js
+var gGotMsgAdded = false;
 
-/* exported alert */ function alert(aDialogTitle, aText) {
+/* exported alert */
+// to alertTestUtils.js
+function alert(aDialogTitle, aText) {
   Assert.ok(aText.startsWith("Connection to server localhost timed out."));
   gGotAlert = true;
   async_driver();
 }
 
 var CopyListener = {
   OnStartCopy() {},
   OnProgress(aProgress, aProgressMax) {},
--- a/mailnews/imap/test/unit/test_imapPasswordFailure.js
+++ b/mailnews/imap/test/unit/test_imapPasswordFailure.js
@@ -16,19 +16,21 @@ var { Services } = ChromeUtils.import("r
 load("../../../resources/alertTestUtils.js");
 load("../../../resources/passwordStorage.js");
 
 var kUserName = "user";
 var kInvalidPassword = "imaptest";
 var kValidPassword = "password";
 
 var incomingServer, server;
-var attempt = 0; // to alertTestUtils.js
+var attempt = 0;
 
-/* exported confirmEx, promptPasswordPS */ function confirmEx(
+/* exported confirmEx, promptPasswordPS */
+// to alertTestUtils.js
+function confirmEx(
   aDialogTitle,
   aText,
   aButtonFlags,
   aButton0Title,
   aButton1Title,
   aButton2Title,
   aCheckMsg,
   aCheckState
--- a/mailnews/imap/test/unit/test_offlineStoreLocking.js
+++ b/mailnews/imap/test/unit/test_offlineStoreLocking.js
@@ -15,19 +15,21 @@ load("../../../resources/alertTestUtils.
 
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 
 // Globals
 var gIMAPTrashFolder, gMsgImapInboxFolder;
 var gGotAlert = false;
-var gMovedMsgId; // to alertTestUtils.js
+var gMovedMsgId;
 
-/* exported alert */ function alert(aDialogTitle, aText) {
+/* exported alert */
+// to alertTestUtils.js
+function alert(aDialogTitle, aText) {
   // do_check_true(aText.startsWith("Connection to server Mail for  timed out."));
   gGotAlert = true;
 }
 
 function addGeneratedMessagesToServer(messages, mailbox) {
   // Create the imapMessages and store them on the mailbox
   messages.forEach(function(message) {
     let dataUri = Services.io.newURI(
--- a/mailnews/imap/test/unit/test_starttlsFailure.js
+++ b/mailnews/imap/test/unit/test_starttlsFailure.js
@@ -10,19 +10,21 @@ var { MailServices } = ChromeUtils.impor
 
 /* import-globals-from ../../../test/resources/logHelper.js */
 /* import-globals-from ../../../test/resources/alertTestUtils.js */
 /* import-globals-from ../../../test/resources/asyncTestUtils.js */
 load("../../../resources/logHelper.js");
 load("../../../resources/alertTestUtils.js");
 load("../../../resources/asyncTestUtils.js");
 
-var gGotAlert = false; // to asyncTestUtils.js
+var gGotAlert = false;
 
-/* exported alert */ function alert(aDialogTitle, aText) {
+/* exported alert */
+// to asyncTestUtils.js
+function alert(aDialogTitle, aText) {
   Assert.ok(aText.startsWith("Server localhost has disconnected"));
   gGotAlert = true;
 }
 
 var tests = [setup, check_alert, teardown];
 
 function* setup() {
   // set up IMAP fakeserver and incoming server