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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js

Issue 2384533002: [DevTools] Better label for async function call stacks (Closed)
Patch Set: addressed comments 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
Index: third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
index dd8c216312ecf64d02e6a3db9bc1b8d31477593f..845f48573176441fa01948c6281e0a8fef3ea013 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
@@ -1239,7 +1239,8 @@ WebInspector.DebuggerPausedDetails = function(debuggerModel, callFrames, reason,
this.reason = reason;
this.auxData = auxData;
this.breakpointIds = breakpointIds;
- this.asyncStackTrace = asyncStackTrace;
+ if (asyncStackTrace)
+ this.asyncStackTrace = this._cleanRedundantFrames(asyncStackTrace);
}
WebInspector.DebuggerPausedDetails.prototype = {
@@ -1253,6 +1254,26 @@ WebInspector.DebuggerPausedDetails.prototype = {
return this.target().runtimeModel.createRemoteObject(/** @type {!RuntimeAgent.RemoteObject} */(this.auxData));
},
+ /**
+ * @param {!RuntimeAgent.StackTrace} asyncStackTrace
+ * @return {!RuntimeAgent.StackTrace}
+ */
+ _cleanRedundantFrames: function(asyncStackTrace)
+ {
+ var stack = asyncStackTrace;
+ var previous = null;
+ while (stack) {
+ if (stack.description === "async function" && stack.callFrames.length)
+ stack.callFrames.shift();
+ if (previous && !stack.callFrames.length)
+ previous.parent = stack.parent;
+ else
+ previous = stack;
+ stack = stack.parent;
+ }
+ return asyncStackTrace;
+ },
+
__proto__: WebInspector.SDKObject.prototype
}

Powered by Google App Engine
This is Rietveld 408576698