Bug 826329 - Remove use of for each from Venkman debugger - broken in nightly loads r=gijskruitbosch+bugs
authorMichael Kraft [:morac] <morac99-firefox2@yahoo.com>
Sun, 20 Jan 2013 22:16:45 +0000
changeset 961 a87d00b27490ddaff1f7673a9c282a3a2f2b64f0
parent 953 6999cfe69761fce02038b5a33f300928c40019a2
child 974 6e0d12cfb96455f642e4cb2c6012d63ff336fe8b
push id219
push useriann_cvs@blueyonder.co.uk
push dateSun, 20 Jan 2013 22:17:58 +0000
reviewersgijskruitbosch
bugs826329
Bug 826329 - Remove use of for each from Venkman debugger - broken in nightly loads r=gijskruitbosch+bugs
resources/content/venkman-views.js
--- a/resources/content/venkman-views.js
+++ b/resources/content/venkman-views.js
@@ -3581,27 +3581,28 @@ function s2v_getselectedtextfortab (inde
     var text = "";
     var browser = this.sourceTabList[index].iframe;
     var sel = browser.contentWindow.getSelection();
     for (var i = 0; i < sel.rangeCount; ++i)
     {
         var fragment = sel.getRangeAt(i).cloneContents();
         if (fragment.hasChildNodes())
         {
-            var node, childNode;
-            for each (node in fragment.childNodes)
+            for (var j = 0; j < fragment.childNodes.length; j++)
             {
+                var node = fragment.childNodes[j];
                 if (node.nodeType == Node.TEXT_NODE)
                 {
                     text += filterFn(node.textContent);
                 }
                 else if (node.nodeType == Node.ELEMENT_NODE)
                 {
-                    for each (childNode in node.childNodes)
+                    for (var k = 0; k < node.childNodes.length; k++)
                     {
+                        var childNode = node.childNodes[k];
                         // skip breakpoint markers and line numbers
                         var nodeName = childNode.nodeName;
                         if (nodeName == "margin" || nodeName == "num")
                             continue;
                         text += filterFn(childNode.textContent);
                     }
                 }
             }