Bug 1207491 - Part 2: Remove use of expression closure from browser/components/customizableui/PanelWideWidgetTracker.jsm. r=Gijs
authorTooru Fujisawa <arai_a@mac.com>
Wed, 23 Sep 2015 18:36:20 +0900
changeset 264339 743f5d1969fef59b466082b0c9da5a58b7975d37
parent 264338 9fc118882677ac5881f3790fe24d92a94d3bc7af
child 264340 b87fee73b0a0ae85fe76d206c5086c3650291222
push id65606
push userarai_a@mac.com
push dateFri, 25 Sep 2015 08:14:49 +0000
treeherdermozilla-inbound@e4f5f909df68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1207491
milestone44.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 1207491 - Part 2: Remove use of expression closure from browser/components/customizableui/PanelWideWidgetTracker.jsm. r=Gijs
browser/components/customizableui/PanelWideWidgetTracker.jsm
--- a/browser/components/customizableui/PanelWideWidgetTracker.jsm
+++ b/browser/components/customizableui/PanelWideWidgetTracker.jsm
@@ -92,19 +92,19 @@ var PanelWideWidgetTracker = {
       return;
     }
     this.adjusting = true;
     let widgetsAffected = [w for (w of gPanelPlacements) if (gWideWidgets.has(w))];
     // If we're moving the wide widgets forwards (down/to the right in the panel)
     // we want to start with the last widgets. Otherwise we move widgets over other wide
     // widgets, which might mess up their order. Likewise, if moving backwards we should start with
     // the first widget and work our way down/right from there.
-    let compareFn = aMoveForwards ? (function(a, b) a < b) : (function(a, b) a > b)
-    widgetsAffected.sort(function(a, b) compareFn(gPanelPlacements.indexOf(a),
-                                                  gPanelPlacements.indexOf(b)));
+    let compareFn = aMoveForwards ? ((a, b) => a < b) : ((a, b) => a > b);
+    widgetsAffected.sort((a, b) => compareFn(gPanelPlacements.indexOf(a),
+                                             gPanelPlacements.indexOf(b)));
     for (let widget of widgetsAffected) {
       this.adjustPosition(widget, aMoveForwards);
     }
     this.adjusting = false;
   },
   // This function is called whenever an item gets moved in the menu panel. It
   // adjusts the position of widgets within the panel to prevent "gaps" between
   // wide widgets that could be filled up with single column widgets