Bug 1120093 - Do not use '=' operator inside while() condition in test_imapSearch.js as it suddenly causes a SyntaxError. r=rkent, a=Standard8
authoraceman <acelists@atlas.sk>
Tue, 13 Jan 2015 13:42:16 -0800
changeset 22175 fdcb700082b60c50fa5b386a62e507422b23647b
parent 22174 ce25f6b1662d34d3bbee7b9763a4d39b914b0d91
child 22176 8628a25098205782fed095d00b8e671587502b15
push id222
push usermbanner@mozilla.com
push dateMon, 30 Mar 2015 08:24:45 +0000
reviewersrkent, Standard8
bugs1120093
Bug 1120093 - Do not use '=' operator inside while() condition in test_imapSearch.js as it suddenly causes a SyntaxError. r=rkent, a=Standard8
mailnews/imap/test/unit/test_imapSearch.js
--- a/mailnews/imap/test/unit/test_imapSearch.js
+++ b/mailnews/imap/test/unit/test_imapSearch.js
@@ -232,17 +232,17 @@ var searchTests =
       testAttribute: OtherHeader,
       op: Contains,
       customHeader: "nospace",
       count: 1},
     { testString: "too much space",
       testAttribute: OtherHeader,
       op: Contains,
       customHeader: "withspace",
-      count: 1},
+      count: 1}
 ];
 
 // load and update a message in the imap fake server
 function loadImapMessage()
 {
   IMAPPump.mailbox.addMessage(new imapMessage(specForFileName(gMessage),
                           IMAPPump.mailbox.uidnext++, []));
   IMAPPump.inbox.updateFolderWithListener(null, asyncUrlListener);
@@ -251,28 +251,28 @@ function loadImapMessage()
   do_check_eq(1, IMAPPump.inbox.getTotalMessages(false));
   yield true;
 }
 
 // process each test from queue, calls itself upon completion of each search
 var testObject;
 function testSearch()
 {
-  let test;
-  while (test = searchTests.shift())
+  while (searchTests.length)
   {
-    if (test && test.dbHeader)
+    let test = searchTests.shift();
+    if (test.dbHeader)
     {
       //  test of a custom db header
       dump("testing dbHeader " + test.dbHeader + "\n");
       let customValue = mailTestUtils.firstMsgHdr(IMAPPump.inbox)
                                      .getProperty(test.dbHeader);
       do_check_eq(customValue, test.testString);
     }
-    else if (test)
+    else
     {
       dump("testing for string '" + test.testString + "'\n");
       testObject = new TestSearch(IMAPPump.inbox,
                            test.testString,
                            test.testAttribute,
                            test.op,
                            test.count,
                            async_driver,