[gnome-shell/wip/fmuellner/test-fixes: 3/6] tests: Replace "for each" construct



commit 7a7a89019c277a744e6b1ff67cd15737dd152cf5
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Feb 6 23:25:29 2018 +0100

    tests: Replace "for each" construct
    
    It is no longer supported by recent mozjs versions, so replace it with
    a regular for loop to unbreak the tests.

 tests/interactive/background-size.js | 6 +++---
 tests/interactive/icons.js           | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/tests/interactive/background-size.js b/tests/interactive/background-size.js
index f3b780fd9..cb66b9700 100644
--- a/tests/interactive/background-size.js
+++ b/tests/interactive/background-size.js
@@ -81,16 +81,16 @@ function test() {
         tbox = new St.BoxLayout({ style: 'spacing: 20px;' });
         vbox.add(tbox);
 
-        for each (let s in backgroundSizes)
+        for (let s of backgroundSizes)
             addTestCase(image, size, s, false);
-        for each (let s in backgroundSizes)
+        for (let s of backgroundSizes)
             addTestCase(image, size, s, true);
     }
 
     function addTestImage(image) {
         const containerSizes = [[100, 100], [200, 200], [250, 250], [100, 250], [250, 100]];
 
-        for each (let size in containerSizes)
+        for (let size of containerSizes)
             addTestLine(image, size);
     }
 
diff --git a/tests/interactive/icons.js b/tests/interactive/icons.js
index 39ef09e6b..55afdbf2b 100644
--- a/tests/interactive/icons.js
+++ b/tests/interactive/icons.js
@@ -48,7 +48,7 @@ function test() {
     function iconRow(icons, box_style) {
         let hb = new St.BoxLayout({ vertical: false, style: box_style });
 
-        for each (let iconName in icons) {
+        for (let iconName of icons) {
             hb.add(new St.Icon({ icon_name: iconName,
                                  icon_size: 48 }));
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]