Bug 822548 - Fix a bunch of JS warnings on startup. r=dao
authorCameron McCormack <cam@mcc.id.au>
Wed, 19 Dec 2012 09:27:56 +1100
changeset 125558 18e8cb967f00bfb5146f4e07ab5c9f900ffa70f1
parent 125557 2b374ff0f5297377da54571771f8e3cd8b773b9e
child 125559 1ac81b33e4923a7fa51f266a42fb59d449f9662d
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs822548
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 822548 - Fix a bunch of JS warnings on startup. r=dao
browser/components/sessionstore/src/SessionStore.jsm
browser/modules/NewTabUtils.jsm
toolkit/components/nsDefaultCLH.js
toolkit/components/url-classifier/content/moz/debug.js
toolkit/mozapps/update/nsUpdateService.js
--- a/browser/components/sessionstore/src/SessionStore.jsm
+++ b/browser/components/sessionstore/src/SessionStore.jsm
@@ -1268,18 +1268,18 @@ let SessionStoreInternal = {
     delete browser.__SS_data;
     delete browser.__SS_tabStillLoading;
     delete browser.__SS_formDataSaved;
     delete browser.__SS_hostSchemeData;
 
     // If this tab was in the middle of restoring or still needs to be restored,
     // we need to reset that state. If the tab was restoring, we will attempt to
     // restore the next tab.
-    let previousState;
-    if (previousState = browser.__SS_restoreState) {
+    let previousState = browser.__SS_restoreState;
+    if (previousState) {
       this._resetTabRestoringState(aTab);
       if (previousState == TAB_STATE_RESTORING)
         this.restoreNextTab();
     }
 
     if (!aNoNotification) {
       this.saveStateDelayed(aWindow);
     }
--- a/browser/modules/NewTabUtils.jsm
+++ b/browser/modules/NewTabUtils.jsm
@@ -534,17 +534,17 @@ let PlacesProvider = {
     options.sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_FRECENCY_DESCENDING
 
     let links = [];
 
     let callback = {
       handleResult: function (aResultSet) {
         let row;
 
-        while (row = aResultSet.getNextRow()) {
+        while ((row = aResultSet.getNextRow())) {
           let url = row.getResultByIndex(1);
           if (LinkChecker.checkLoadURI(url)) {
             let title = row.getResultByIndex(2);
             links.push({url: url, title: title});
           }
         }
       },
 
--- a/toolkit/components/nsDefaultCLH.js
+++ b/toolkit/components/nsDefaultCLH.js
@@ -39,32 +39,32 @@ nsDefaultCLH.prototype = {
   /* nsISupports */
 
   QueryInterface : XPCOMUtils.generateQI([nsICommandLineHandler]),
 
   /* nsICommandLineHandler */
 
   handle : function clh_handle(cmdLine) {
     var printDir;
-    while (printDir = cmdLine.handleFlagWithParam("print-xpcom-dir", false)) {
+    while ((printDir = cmdLine.handleFlagWithParam("print-xpcom-dir", false))) {
       var out = "print-xpcom-dir(\"" + printDir + "\"): ";
       try {
         out += getDirectoryService().get(printDir, nsIFile).path;
       }
       catch (e) {
         out += "<Not Provided>";
       }
 
       dump(out + "\n");
       Components.utils.reportError(out);
     }
 
     var printDirList;
-    while (printDirList = cmdLine.handleFlagWithParam("print-xpcom-dirlist",
-                                                      false)) {
+    while ((printDirList = cmdLine.handleFlagWithParam("print-xpcom-dirlist",
+                                                       false))) {
       out = "print-xpcom-dirlist(\"" + printDirList + "\"): ";
       try {
         var list = getDirectoryService().get(printDirList,
                                              nsISimpleEnumerator);
         while (list.hasMoreElements())
           out += list.getNext().QueryInterface(nsIFile).path + ";";
       }
       catch (e) {
--- a/toolkit/components/url-classifier/content/moz/debug.js
+++ b/toolkit/components/url-classifier/content/moz/debug.js
@@ -601,20 +601,20 @@ G_DebugService.prototype.observe = funct
   }
 }
 
 /**
  * Private helper to report an nsIScriptError instance to the log/console.
  */
 G_DebugService.prototype.reportScriptError_ = function(message, sourceName, 
                                                        lineNumber, label) {
-  var message = "\n------------------------------------------------------------\n" +
-                label + ": " + message +
-                "\nlocation: " + sourceName + ", " + "line: " + lineNumber +
-                "\n------------------------------------------------------------\n\n";
+  message = "\n------------------------------------------------------------\n" +
+            label + ": " + message +
+            "\nlocation: " + sourceName + ", " + "line: " + lineNumber +
+            "\n------------------------------------------------------------\n\n";
 
   dump(message);
   this.maybeDumpToFile(message);
 }
 
 
 
 /**
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -3617,19 +3617,19 @@ Downloader.prototype = {
 
     if (state == STATE_DOWNLOAD_FAILED) {
       var allFailed = true;
       // Check if there is a complete update patch that can be downloaded.
       if (!this._update.isCompleteUpdate && this._update.patchCount == 2) {
         LOG("Downloader:onStopRequest - verification of patch failed, " +
             "downloading complete update patch");
         this._update.isCompleteUpdate = true;
-        var status = this.downloadUpdate(this._update);
-
-        if (status == STATE_NONE) {
+        let updateStatus = this.downloadUpdate(this._update);
+
+        if (updateStatus == STATE_NONE) {
           cleanupActiveUpdate();
         } else {
           allFailed = false;
         }
       }
 
       if (allFailed) {
         LOG("Downloader:onStopRequest - all update patch downloads failed");