Title: [202055] trunk/Source/WebInspectorUI
Revision
202055
Author
sbar...@apple.com
Date
2016-06-14 11:42:17 -0700 (Tue, 14 Jun 2016)

Log Message

Follow up to: Web Inspector: Call Trees view should have a 'Top Functions'-like mode
https://bugs.webkit.org/show_bug.cgi?id=158555
<rdar://problem/26712544>

Unreviewed follow up patch.

- Move a long if-else sequence to a switch statement.
- Fix a copy-paste typo in a Symbol(.) enum.

* UserInterface/Models/CallingContextTree.js:
(WebInspector.CallingContextTree.prototype.updateTreeWithStackTrace):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (202054 => 202055)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-06-14 18:37:17 UTC (rev 202054)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-06-14 18:42:17 UTC (rev 202055)
@@ -1,3 +1,17 @@
+2016-06-14  Saam Barati  <sbar...@apple.com>
+
+        Follow up to: Web Inspector: Call Trees view should have a 'Top Functions'-like mode
+        https://bugs.webkit.org/show_bug.cgi?id=158555
+        <rdar://problem/26712544>
+
+        Unreviewed follow up patch.
+
+        - Move a long if-else sequence to a switch statement.
+        - Fix a copy-paste typo in a Symbol(.) enum.
+
+        * UserInterface/Models/CallingContextTree.js:
+        (WebInspector.CallingContextTree.prototype.updateTreeWithStackTrace):
+
 2016-06-13  Joseph Pecoraro  <pecor...@apple.com>
 
         Web Inspector: Show Exception Stack in UncaughtExceptionReporter view

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/CallingContextTree.js (202054 => 202055)


--- trunk/Source/WebInspectorUI/UserInterface/Models/CallingContextTree.js	2016-06-14 18:37:17 UTC (rev 202054)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CallingContextTree.js	2016-06-14 18:42:17 UTC (rev 202055)
@@ -57,19 +57,22 @@
         let node = this._root;
         node.addTimestampAndExpressionLocation(timestamp, duration, null);
 
-        if (this._type === WebInspector.CallingContextTree.Type.TopDown) {
+        switch (this._type) {
+        case WebInspector.CallingContextTree.Type.TopDown:
             for (let i = stackFrames.length; i--; ) {
                 let stackFrame = stackFrames[i];
                 node = node.findOrMakeChild(stackFrame);
                 node.addTimestampAndExpressionLocation(timestamp, duration, stackFrame.expressionLocation || null, i === 0);
             }
-        } else if (this._type === WebInspector.CallingContextTree.Type.BottomUp) {
+            break;
+        case WebInspector.CallingContextTree.Type.BottomUp:
             for (let i = 0; i < stackFrames.length; ++i) {
                 let stackFrame = stackFrames[i];
                 node = node.findOrMakeChild(stackFrame);
                 node.addTimestampAndExpressionLocation(timestamp, duration, stackFrame.expressionLocation || null, i === 0);
             }
-        } else if (this._type === WebInspector.CallingContextTree.Type.TopFunctionsTopDown){
+            break;
+        case WebInspector.CallingContextTree.Type.TopFunctionsTopDown:
             for (let i = stackFrames.length; i--; ) {
                 node = this._root;
                 for (let j = i + 1; j--; ) {
@@ -78,8 +81,8 @@
                     node.addTimestampAndExpressionLocation(timestamp, duration, stackFrame.expressionLocation || null, j === 0);
                 }
             }
-        } else {
-            console.assert(this._type === WebInspector.CallingContextTree.Type.TopFunctionsBottomUp);
+            break;
+        case WebInspector.CallingContextTree.Type.TopFunctionsBottomUp:
             for (let i = 0; i < stackFrames.length; i++) {
                 node = this._root;
                 for (let j = i; j < stackFrames.length; j++) {
@@ -88,6 +91,10 @@
                     node.addTimestampAndExpressionLocation(timestamp, duration, stackFrame.expressionLocation || null, j === 0);
                 }
             }
+            break;
+        default:
+            console.assert(false, "This should not be reached.");
+            break;
         }
     }
 
@@ -382,5 +389,5 @@
     TopDown: Symbol("TopDown"),
     BottomUp: Symbol("BottomUp"),
     TopFunctionsTopDown: Symbol("TopFunctionsTopDown"),
-    TopFunctionsBottomUp: Symbol("TopFunctionsTopDown"),
+    TopFunctionsBottomUp: Symbol("TopFunctionsBottomUp"),
 };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to