Bug 1540879 - Stop using deprecated Array generics in tabbox.xml. r=Gijs
authorDão Gottwald <dao@mozilla.com>
Wed, 17 Apr 2019 08:38:46 +0000
changeset 469787 2a745d4407f4
parent 469786 042fc8652d7a
child 469788 01d9700306a4
push id35882
push usercbrindusan@mozilla.com
push dateWed, 17 Apr 2019 15:54:01 +0000
treeherdermozilla-central@37185c0ae520 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1540879
milestone68.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 1540879 - Stop using deprecated Array generics in tabbox.xml. r=Gijs Differential Revision: https://phabricator.services.mozilla.com/D27754
toolkit/content/widgets/tabbox.xml
--- a/toolkit/content/widgets/tabbox.xml
+++ b/toolkit/content/widgets/tabbox.xml
@@ -153,20 +153,21 @@
           return -1;
         ]]>
         </getter>
 
         <setter>
         <![CDATA[
           var tab = this.getItemAtIndex(val);
           if (tab) {
-            Array.forEach(this.children, function(aTab) {
-              if (aTab.selected && aTab != tab)
-                aTab._selected = false;
-            });
+            for (let otherTab of this.children) {
+              if (otherTab != tab && otherTab.selected) {
+                otherTab._selected = false;
+              }
+            }
             tab._selected = true;
 
             this.setAttribute("value", tab.value);
 
             let linkedPanel = this.getRelatedElement(tab);
             if (linkedPanel) {
               this.tabbox.setAttribute("selectedIndex", val);
 
@@ -249,17 +250,17 @@
         ]]>
         </setter>
       </property>
 
       <method name="getIndexOfItem">
         <parameter name="item"/>
         <body>
         <![CDATA[
-          return Array.indexOf(this.children, item);
+          return Array.prototype.indexOf.call(this.children, item);
         ]]>
         </body>
       </method>
 
       <method name="getItemAtIndex">
         <parameter name="index"/>
         <body>
         <![CDATA[