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 |
} |