Bug 1113031 - Replace deprecated expression closures in about:sessionrestore with real functions. r=ttaubert
authorChris Peterson <cpeterson@mozilla.com>
Tue, 16 Dec 2014 19:42:45 -0800
changeset 220571 074eb94f2c2edfe0efa1daae0ebdbfd00c733911
parent 220570 f29790f7e13ee0bc1a2da59008f528aff96132d5
child 220572 1abcfb25a98e20e2259a21103c6a9452eb774047
push id10503
push userryanvm@gmail.com
push dateFri, 19 Dec 2014 20:13:42 +0000
treeherderfx-team@98ee95ac6be5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert
bugs1113031
milestone37.0a1
Bug 1113031 - Replace deprecated expression closures in about:sessionrestore with real functions. r=ttaubert
browser/components/sessionstore/content/aboutSessionRestore.js
--- a/browser/components/sessionstore/content/aboutSessionRestore.js
+++ b/browser/components/sessionstore/content/aboutSessionRestore.js
@@ -119,17 +119,17 @@ function restoreSession() {
 
     // remove all unselected tabs from the state before restoring it
     var ix = gStateObject.windows.length - 1;
     for (var t = gTreeData.length - 1; t >= 0; t--) {
       if (treeView.isContainer(t)) {
         if (gTreeData[t].checked === 0)
           // this window will be restored partially
           gStateObject.windows[ix].tabs =
-            gStateObject.windows[ix].tabs.filter(function(aTabData, aIx)
+            gStateObject.windows[ix].tabs.filter((aTabData, aIx) =>
                                                    gTreeData[t].tabs[aIx].checked);
         else if (!gTreeData[t].checked)
           // this window won't be restored at all
           gStateObject.windows.splice(ix, 1);
         ix--;
       }
     }
   }
@@ -213,22 +213,24 @@ function onListKeyDown(aEvent) {
 
 function getBrowserWindow() {
   return window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebNavigation)
                .QueryInterface(Ci.nsIDocShellTreeItem).rootTreeItem
                .QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);
 }
 
 function toggleRowChecked(aIx) {
+  function isChecked(aItem) {
+    return aItem.checked;
+  }
+
   var item = gTreeData[aIx];
   item.checked = !item.checked;
   treeView.treeBox.invalidateRow(aIx);
 
-  function isChecked(aItem) aItem.checked;
-
   if (treeView.isContainer(aIx)) {
     // (un)check all tabs of this window as well
     for (let tab of item.tabs) {
       tab.checked = item.checked;
       treeView.treeBox.invalidateRow(gTreeData.indexOf(tab));
     }
   }
   else {