Index: third_party/WebKit/Source/devtools/front_end/components/DebuggerPresentationUtils.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/components/DebuggerPresentationUtils.js b/third_party/WebKit/Source/devtools/front_end/components/DebuggerPresentationUtils.js |
index b5719fc399fbe26bf579420ef7018f4120cab769..880a74f7c0daec375b83a013655a3e27417fea0b 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/components/DebuggerPresentationUtils.js |
+++ b/third_party/WebKit/Source/devtools/front_end/components/DebuggerPresentationUtils.js |
@@ -6,44 +6,45 @@ WebInspector.DebuggerPresentationUtils = {} |
/** |
* @param {?WebInspector.DebuggerModel} debuggerModel |
- * @param {!Array.<!ConsoleAgent.CallFrame>=} stackTrace |
- * @param {!ConsoleAgent.AsyncStackTrace=} asyncStackTrace |
+ * @param {!RuntimeAgent.StackTrace=} stackTrace |
* @param {boolean=} showBlackboxed |
- * @return {?ConsoleAgent.CallFrame} |
+ * @return {?RuntimeAgent.CallFrame} |
*/ |
-WebInspector.DebuggerPresentationUtils.callFrameAnchorFromStackTrace = function(debuggerModel, stackTrace, asyncStackTrace, showBlackboxed) |
+WebInspector.DebuggerPresentationUtils.callFrameAnchorFromStackTrace = function(debuggerModel, stackTrace, showBlackboxed) |
{ |
+ if (!stackTrace) |
+ return null; |
/** |
- * @param {?Array.<!ConsoleAgent.CallFrame>=} stackTrace |
- * @return {?ConsoleAgent.CallFrame} |
+ * @param {!Array.<!RuntimeAgent.CallFrame>=} callFrames |
dgozman
2016/02/04 01:43:06
stackTrace.callFrames cannot be optional.
pfeldman
2016/02/04 03:15:59
Done.
|
+ * @return {?RuntimeAgent.CallFrame} |
*/ |
- function innerCallFrameAnchorFromStackTrace(stackTrace) |
+ function innerCallFrameAnchorFromStackTrace(callFrames) |
{ |
- if (!stackTrace || !stackTrace.length) |
+ if (!callFrames.length) |
return null; |
if (showBlackboxed) |
- return stackTrace[0]; |
- for (var i = 0; i < stackTrace.length; ++i) { |
- var script = debuggerModel && debuggerModel.scriptForId(stackTrace[i].scriptId); |
+ return callFrames[0]; |
+ for (var i = 0; i < callFrames.length; ++i) { |
+ var script = debuggerModel && debuggerModel.scriptForId(callFrames[i].scriptId); |
var blackboxed = script ? |
WebInspector.BlackboxSupport.isBlackboxed(script.sourceURL, script.isContentScript()) : |
- WebInspector.BlackboxSupport.isBlackboxedURL(stackTrace[i].url); |
+ WebInspector.BlackboxSupport.isBlackboxedURL(callFrames[i].url); |
if (!blackboxed) |
- return stackTrace[i]; |
+ return callFrames[i]; |
} |
return null; |
} |
- var callFrame = innerCallFrameAnchorFromStackTrace(stackTrace); |
+ var callFrame = innerCallFrameAnchorFromStackTrace(stackTrace.callFrames); |
dgozman
2016/02/04 01:43:06
This section can be merged into |while| below.
pfeldman
2016/02/04 03:15:59
Done.
|
if (callFrame) |
return callFrame; |
+ var asyncStackTrace = callFrame.parent; |
while (asyncStackTrace) { |
callFrame = innerCallFrameAnchorFromStackTrace(asyncStackTrace.callFrames); |
if (callFrame) |
return callFrame; |
- asyncStackTrace = asyncStackTrace.asyncStackTrace; |
+ asyncStackTrace = asyncStackTrace.parent; |
} |
- |
- return stackTrace ? stackTrace[0] : null; |
+ return stackTrace.callFrames.length ? stackTrace.callFrames[0] : null; |
} |