Bug 1313634 - Fix undefined variables issues in cookies.js that lead to the cookies window not updating properly when open. r?jaws draft
authorMark Banner <standard8@mozilla.com>
Fri, 28 Oct 2016 12:16:36 +0100
changeset 431501 7727f99d1c21a5dd2fd7f747bee79097a65aac95
parent 431500 969c3295d3aa77931cca26eddb047d9d74bd9858
child 535407 7493768528a936518d7b4eeaf0b173cd1ba19bf0
push id34046
push userbmo:standard8@mozilla.com
push dateSat, 29 Oct 2016 13:50:40 +0000
reviewersjaws
bugs1313634
milestone52.0a1
Bug 1313634 - Fix undefined variables issues in cookies.js that lead to the cookies window not updating properly when open. r?jaws MozReview-Commit-ID: RBhuCbjrYT
browser/components/preferences/cookies.js
--- a/browser/components/preferences/cookies.js
+++ b/browser/components/preferences/cookies.js
@@ -122,20 +122,20 @@ var gCookiesWindow = {
     // We don't yet handle aData == "deleted" - it's a less common case
     // and is rather complicated as selection tracking is difficult
   },
 
   _handleCookieChanged: function (changedCookie, strippedHost) {
     var rowIndex = 0;
     var cookieItem = null;
     if (!this._view._filtered) {
-      for (let host of this._hostsOrder) { // (var host in this._hosts) {
+      for (let host of this._hostOrder) {
         ++rowIndex;
         var hostItem = this._hosts[host];
-        if (this._hostOrder[i] == strippedHost) { // host == strippedHost) {
+        if (host == strippedHost) {
           // Host matches, look for the cookie within this Host collection
           // and update its data
           for (let currCookie of hostItem.cookies) {
             ++rowIndex;
             if (this._cookieEquals(currCookie, changedCookie, strippedHost)) {
               currCookie.value    = changedCookie.value;
               currCookie.isSecure = changedCookie.isSecure;
               currCookie.isDomain = changedCookie.isDomain;
@@ -883,17 +883,17 @@ var gCookiesWindow = {
     for (let i = 0; i < rangeCount; ++i) {
       var min = {}; var max = {};
       seln.getRangeAt(i, min, max);
       this._lastSelectedRanges.push({ min: min.value, max: max.value });
     }
 
     // Save open states
     this._openIndices = [];
-    for (i = 0; i < this._view.rowCount; ++i) {
+    for (let i = 0; i < this._view.rowCount; ++i) {
       var item = this._view._getItemAtIndex(i);
       if (item && item.container && item.open)
         this._openIndices.push(i);
     }
   },
 
   _updateRemoveAllButton: function gCookiesWindow__updateRemoveAllButton() {
     document.getElementById("removeAllCookies").disabled = this._view._rowCount == 0;