Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js

Issue 2384533002: [DevTools] Better label for async function call stacks (Closed)
Patch Set: rebased tests and removed virtual test suite Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
index 9c470b37599a48a7ead747fabb3565b71129f24b..f70826661b26fe072f23cbfb383f90e56c45cd93 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
@@ -81,12 +81,23 @@ WebInspector.CallStackSidebarPane.prototype = {
this._appendSidebarCallFrames(this._callFramesFromDebugger(details.callFrames));
var topStackHidden = (this._hiddenCallFrames === this.callFrames.length);
+ var peviousStackTrace = details.callFrames;
while (asyncStackTrace) {
- var title = WebInspector.asyncStackTraceLabel(asyncStackTrace.description);
+ var title = "";
+ if (asyncStackTrace.description === "async function") {
+ var lastPreviousFrame = peviousStackTrace[peviousStackTrace.length - 1];
+ var topFrame = asyncStackTrace.callFrames[0];
+ var lastPreviousFrameName = WebInspector.beautifyFunctionName(lastPreviousFrame.functionName);
+ var topFrameName = WebInspector.beautifyFunctionName(topFrame.functionName);
+ title = topFrameName + " awaits " + lastPreviousFrameName;
+ } else {
+ title = WebInspector.asyncStackTraceLabel(asyncStackTrace.description);
+ }
var asyncCallFrame = new WebInspector.UIList.Item(title, "", true);
asyncCallFrame.setHoverable(false);
asyncCallFrame.element.addEventListener("contextmenu", this._asyncCallFrameContextMenu.bind(this, this.callFrames.length), true);
this._appendSidebarCallFrames(this._callFramesFromRuntime(asyncStackTrace.callFrames, asyncCallFrame), asyncCallFrame);
+ peviousStackTrace = asyncStackTrace.callFrames;
asyncStackTrace = asyncStackTrace.parent;
}
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698