From 45f3d2bf068f90b8a397bbada9b07dda7c831647 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sat, 7 Apr 2018 12:33:16 -0400 Subject: [PALEMOON] Fix for loops in DownloadsCommon.jsm and WindowsPreviewPerTab.jsm (SyntaxError: missing ] after element list) --- .../palemoon/components/downloads/DownloadsCommon.jsm | 16 +++++++++++++--- application/palemoon/modules/WindowsPreviewPerTab.jsm | 9 ++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) (limited to 'application/palemoon') diff --git a/application/palemoon/components/downloads/DownloadsCommon.jsm b/application/palemoon/components/downloads/DownloadsCommon.jsm index b90baaf9c..0921f8400 100644 --- a/application/palemoon/components/downloads/DownloadsCommon.jsm +++ b/application/palemoon/components/downloads/DownloadsCommon.jsm @@ -867,9 +867,19 @@ DownloadsDataCtor.prototype = { // Sort backwards by start time, ensuring that the most recent // downloads are added first regardless of their state. - let loadedItemsArray = [dataItem - for each (dataItem in this.dataItems) - if (dataItem)]; + // Tycho: + //let loadedItemsArray = [dataItem + // for each (dataItem in this.dataItems) + // if (dataItem)]; + + let loadedItemsArray = []; + + for each (let dataItem in this.dataItems) { + if (dataItem) { + loadedItemsArray.push(dataItem); + } + } + loadedItemsArray.sort(function(a, b) b.startTime - a.startTime); loadedItemsArray.forEach( function (dataItem) aView.onDataItemAdded(dataItem, false) diff --git a/application/palemoon/modules/WindowsPreviewPerTab.jsm b/application/palemoon/modules/WindowsPreviewPerTab.jsm index 41b38f0cf..e186bcad2 100644 --- a/application/palemoon/modules/WindowsPreviewPerTab.jsm +++ b/application/palemoon/modules/WindowsPreviewPerTab.jsm @@ -510,7 +510,14 @@ TabWindow.prototype = { // Previews are internally stored using a map, so we need to iterate over // the tabbrowser's array of tabs to retrieve previews in the same order. - let inorder = [previews.get(t) for (t of tabs) if (previews.has(t))]; + // Tycho: let inorder = [previews.get(t) for (t of tabs) if (previews.has(t))]; + let inorder = []; + + for (let t of tabs) { + if (previews.has(t)) { + inorder.push(previews.get(t)); + } + } // Since the internal taskbar array has not yet been updated, we must force // the sorting order of our local array on it. To do so, we must walk -- cgit v1.2.3