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

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: a 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/LayoutTests/inspector/sources/debugger-ui/async-call-stack-async-function-expected.txt ('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..175dfb3523de9a3cf8307ecc1ce89e6df4ee9b39 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
@@ -81,8 +81,18 @@ WebInspector.CallStackSidebarPane.prototype = {
this._appendSidebarCallFrames(this._callFramesFromDebugger(details.callFrames));
var topStackHidden = (this._hiddenCallFrames === this.callFrames.length);
+ const asyncFunctionDesription = "async function";
while (asyncStackTrace) {
- var title = WebInspector.asyncStackTraceLabel(asyncStackTrace.description);
+ var title = "";
+ if (asyncStackTrace.description === asyncFunctionDesription && asyncStackTrace.callFrames.length > 1) {
+ var redundantFrame = asyncStackTrace.callFrames.shift();
dgozman 2016/10/20 21:37:07 Let's move model mutation to DebuggerModel.
kozy 2016/10/20 22:21:07 Done.
+ var topFrame = asyncStackTrace.callFrames[0];
+ var redundantFrameName = WebInspector.beautifyFunctionName(redundantFrame.functionName);
+ var topFrameName = WebInspector.beautifyFunctionName(topFrame.functionName);
+ title = topFrameName + " awaits " + redundantFrameName;
+ } 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);
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/async-call-stack-async-function-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698