Web Inspector: Fix TreeOutline TypeError:​ this._indexesForSubtree is not a function
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Jan 2019 22:04:35 +0000 (22:04 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Jan 2019 22:04:35 +0000 (22:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193501
<rdar://problem/47323967>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.removeChildAtIndex):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240051 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/TreeOutline.js

index 0c84317..5e4ac45 100644 (file)
@@ -1,3 +1,14 @@
+2019-01-16  Matt Baker  <mattbaker@apple.com>
+
+        Web Inspector: Fix TreeOutline TypeError:​ this._indexesForSubtree is not a function
+        https://bugs.webkit.org/show_bug.cgi?id=193501
+        <rdar://problem/47323967>
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/TreeOutline.js:
+        (WI.TreeOutline.prototype.removeChildAtIndex):
+
 2019-01-15  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Audit: create new IDL type for exposing special functionality in test context
index 9a0183e..a47e60b 100644 (file)
@@ -323,14 +323,15 @@ WI.TreeOutline = class TreeOutline extends WI.Object
                 parent.select(true, false);
         }
 
+        let removedIndexes = null;
+
         let treeOutline = child.treeOutline;
         if (treeOutline) {
             treeOutline._forgetTreeElement(child);
             treeOutline._forgetChildrenRecursive(child);
+            removedIndexes = treeOutline._indexesForSubtree(child);
         }
 
-        let removedIndexes = this._indexesForSubtree(child);
-
         if (child.previousSibling)
             child.previousSibling.nextSibling = child.nextSibling;
         if (child.nextSibling)