Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Web Inspector: should always send Console.StackTrace instead of an ar…
…ray of Console.CallFrame

https://bugs.webkit.org/show_bug.cgi?id=242826

Reviewed by Patrick Angle.

The inspected page already has the full async stack trace information, so sending it to the frontend is just
a matter of using the right protocol type (i.e. one that has a property for the parent `Console.StackTrace`).

This will allow the Web Inspector frontend to show async stack traces everywhere that a stack trace is shown.

* Source/JavaScriptCore/inspector/protocol/Animation.json:
* Source/JavaScriptCore/inspector/protocol/Canvas.json:
* Source/JavaScriptCore/inspector/protocol/Console.json:
* Source/JavaScriptCore/inspector/protocol/Network.json:
* Source/JavaScriptCore/inspector/protocol/Recording.json:

* Source/JavaScriptCore/inspector/ConsoleMessage.cpp:
(Inspector::ConsoleMessage::addToFrontend):
* Source/WebCore/inspector/InspectorCanvas.h:
* Source/WebCore/inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildObjectForCanvas):
(WebCore::InspectorCanvas::indexForData):
(WebCore::InspectorCanvas::buildAction):
* Source/WebCore/inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createGenericRecord):
* Source/WebCore/inspector/agents/InspectorAnimationAgent.cpp:
(WebCore::InspectorAnimationAgent::bindAnimation):
* Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildInitiatorObject):
s/`buildInspectorArray`/`buildInspectorObject`

* Source/JavaScriptCore/inspector/ScriptCallStackFactory.cpp:
(Inspector::CreateScriptCallStackFunctor::CreateScriptCallStackFunctor):
(Inspector::CreateScriptCallStackFunctor::operator() const):
(Inspector::CreateScriptCallStackFunctor::takeStack): Added.
(Inspector::createScriptCallStack):
(Inspector::createScriptCallStackForConsole):
(Inspector::createScriptCallStackFromException):
* Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::currentParentStackTrace const): Added.
Grab the current `AsyncStackTrace` from the `InspectorDebuggerAgent` when creating a `ScriptCallStack`.

* Source/JavaScriptCore/inspector/ScriptCallStack.h:
* Source/JavaScriptCore/inspector/ScriptCallStack.cpp:
(Inspector::ScriptCallStack::create):
(Inspector::ScriptCallStack::ScriptCallStack):
(Inspector::ScriptCallStack::buildInspectorObject const):
Include the `AsyncStackTrace` (if provided) when creating the `Console.StackTrace` protocol object.

* Source/WebInspectorUI/UserInterface/Controllers/CallFrameTreeController.js:
(WI.CallFrameTreeController):
(WI.CallFrameTreeController.prototype.groupBlackboxedStackTrace): Added.
(WI.CallFrameTreeController.prototype.get stackTrace): Renamed from `get callFrames`.
(WI.CallFrameTreeController.prototype.set stackTrace): Renamed from `get stackTrace`.
(WI.CallFrameTreeController.prototype._groupBlackboxedCallFrames): Renamed from `groupBlackboxedCallFrames`.
* Source/WebInspectorUI/UserInterface/Views/ThreadTreeElement.js:
(WI.ThreadTreeElement.prototype.refresh):
Move the logic for generating tree items for async stack traces to a generic helper for wider use.

* Source/WebInspectorUI/UserInterface/Models/DebuggerData.js:
(WI.DebuggerData):
(WI.DebuggerData.prototype.get stackTrace): Renamed from `callFrames`.
(WI.DebuggerData.prototype.updateForPause):
(WI.DebuggerData.prototype.updateForResume):
(WI.DebuggerData.prototype.get asyncStackTrace): Deleted.
* Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.debuggerDidPause):
Instead of having separate `callFrames` and `asyncStackTrace`, just create a `WI.StackTrace`.

* Source/WebInspectorUI/UserInterface/Controllers/ConsoleManager.js:
(WI.ConsoleManager.prototype.messageWasAdded):
* Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.resourceRequestWillBeSent):
(WI.NetworkManager.prototype.resourceRequestWasServedFromMemoryCache):
(WI.NetworkManager.prototype._initiatorStackTraceFromPayload): Renamed from `_initiatorCallFramesFromPayload`.
(WI.NetworkManager.prototype._initiatorSourceCodeLocationFromPayload):
* Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.prototype._processRecord):
(WI.TimelineManager.prototype._stackTraceFromPayload): Renamed from `_callFramesFromPayload`.
* Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js:
(WI.ConsoleMessage):
(WI.ConsoleMessage.prototype.get sourceCodeLocation):
* Source/WebInspectorUI/UserInterface/Models/LayoutTimelineRecord.js:
(WI.LayoutTimelineRecord):
(WI.LayoutTimelineRecord.async fromJSON):
(WI.LayoutTimelineRecord.prototype.toJSON):
* Source/WebInspectorUI/UserInterface/Models/RenderingFrameTimelineRecord.js:
(WI.RenderingFrameTimelineRecord.prototype.durationForTask):
* Source/WebInspectorUI/UserInterface/Models/Resource.js:
(WI.Resource):
(WI.Resource.prototype.get initiatorStackTrace): Renamed from `initiatorCallFrames`.
* Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js:
(WI.ScriptTimelineRecord):
(WI.ScriptTimelineRecord.async fromJSON):
(WI.ScriptTimelineRecord.prototype.toJSON):
* Source/WebInspectorUI/UserInterface/Models/TimelineRecord.js:
(WI.TimelineRecord):
(WI.TimelineRecord.prototype.get stackTrace): Renamed from `callFrames`.
(WI.TimelineRecord.prototype.get initiatorCallFrame):
* Source/WebInspectorUI/UserInterface/Views/AnimationDetailsSidebarPanel.js:
(WI.AnimationDetailsSidebarPanel.prototype._refreshBacktraceSection):
* Source/WebInspectorUI/UserInterface/Views/CanvasDetailsSidebarPanel.js:
(WI.CanvasDetailsSidebarPanel.prototype._refreshBacktraceSection):
* Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
* Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._addThreadIndicatorForTarget):
* Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.js:
(WI.TimelineDataGrid.prototype._dataGridSelectedNodeChanged):
(WI.TimelineDataGrid.prototype._createPopoverContent):
s/`callFrames`/`stackTrace`

* Source/WebInspectorUI/UserInterface/Models/Animation.js:
(WI.Animation.fromPayload):
(WI.Animation.prototype.get stackTrace): Renamed from `backtrace`.
* Source/WebInspectorUI/UserInterface/Models/Canvas.js:
(WI.Canvas.fromPayload):
(WI.Canvas.prototype.get stackTrace): Renamed from `backtrace`.
* Source/WebInspectorUI/UserInterface/Views/RecordingActionTreeElement.js:
(WI.RecordingActionTreeElement.prototype.populateContextMenu):
* Source/WebInspectorUI/UserInterface/Views/RecordingTraceDetailsSidebarPanel.js:
(WI.RecordingTraceDetailsSidebarPanel.prototype.set action):
(WI.RecordingTraceDetailsSidebarPanel):
* Source/WebInspectorUI/UserInterface/Views/RecordingTraceDetailsSidebarPanel.css:
(.sidebar > .details.recording-trace > .content > .no-stack-trace): Renamed from `.sidebar > .details.recording-trace > .content > .no-trace-data`.
(.sidebar > .details.recording-trace > .content > .no-stack-trace > .message): Renamed from `.sidebar > .details.recording-trace > .content > .no-trace-data > .message`.
* Source/WebInspectorUI/UserInterface/Views/ResourceHeadersContentView.js:
(WI.ResourceHeadersContentView.prototype._refreshSummarySection):
s/`backtrace`/`stackTrace`

* Source/WebInspectorUI/UserInterface/Models/Recording.js:
(WI.Recording.prototype.async swizzle):
* Source/WebInspectorUI/UserInterface/Models/RecordingAction.js:
(WI.RecordingAction):
(WI.RecordingAction.fromPayload):
(WI.RecordingAction.prototype.get stackTrace): Renamed from `trace`.
(WI.RecordingAction.prototype.async swizzle):
(WI.RecordingAction.prototype.toJSON):
Bump the `Recording` version and teach the swizzle engine how to (re)create a `WI.StackTrace`.

* Source/WebInspectorUI/UserInterface/Views/CallFrameTreeElement.js:
(WI.CallFrameTreeElement)
* Source/WebInspectorUI/UserInterface/Views/CallFrameTreeElement.css:
(.call-frame:is(.async-boundary, .truncated-boundary)): Renamed from `.tree-outline .item.call-frame.async-boundary`.
(.tree-outline .item.call-frame.async-boundary::before):
(.tree-outline .children .item.call-frame.async-boundary::before):
(.tree-outline.single-thread .children .item.call-frame.async-boundary::before): Renamed from `.tree-outline.single-thread .item.call-frame.async-boundary::before`.
* Source/WebInspectorUI/UserInterface/Views/CallFrameView.js:
(WI.CallFrameView):
Share styles for async/truncated boundary "call frames" between `WI.CallFrameTreeElement` and `WI.CallFrameView`.

* Source/JavaScriptCore/debugger/Debugger.h:
(JSC::Debugger::Client::isInspectorDebuggerAgent const): Added.
(JSC::Debugger::client const): Added.
* Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h:
(isType): Added.
Allow callers to turn a `Debugger::Client` into a `InspectorDebuggerAgent`. This is done so that we
don't have to use `Inspector` objects (specifically `AsyncStackTrace`) inside `JSC::Debugger`.

* Source/JavaScriptCore/inspector/AsyncStackTrace.h:
* Source/JavaScriptCore/inspector/AsyncStackTrace.cpp:
(Inspector::AsyncStackTrace::create):
(Inspector::AsyncStackTrace::AsyncStackTrace):
(Inspector::AsyncStackTrace::at const): Added.
(Inspector::AsyncStackTrace::size const): Added.
(Inspector::AsyncStackTrace::topCallFrameIsBoundary const): Added.
(Inspector::AsyncStackTrace::buildInspectorObject const):
(Inspector::AsyncStackTrace::truncate):
Add some helpers to make generating protocol objects easier.

* Source/WebInspectorUI/UserInterface/Views/TreeElement.js:
(WI.TreeElement.prototype.set selectable):
(WI.TreeElement.prototype._attach):
* Source/WebInspectorUI/UserInterface/Views/TreeOutline.css:
(.tree-outline.non-selectable .item:not(.non-selectable):hover): Renamed from `.tree-outline.non-selectable .item:hover`.
Drive-by: Hovering a non-selectable `WI.TreeElement` should not show a background even if the parent
          `WI.TreeOutline` is also non-selectable.

* Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype.handleCopyEvent):
Drive-by: Copying a truncated boundary "call frame" should behave like copying an async bounary "call frame".

* Source/WebInspectorUI/UserInterface/Views/ThreadTreeElement.css:
(@media (prefers-color-scheme: dark) .tree-outline > .item.thread .icon):
(.tree-outline > .item.thread + ol > .item.truncated-call-frames): Deleted.
(.tree-outline > .item.thread + ol > .item.truncated-call-frames .icon): Deleted.
(@media (prefers-color-scheme: dark) .tree-outline > .item.thread + ol > .item.truncated-call-frames .icon): Deleted.
Drive-by: Use the native [N] icon for truncated boundary "call frame".

* Source/WebInspectorUI/UserInterface/Views/StackTraceView.js:
(WI.StackTraceView):
(WI.StackTraceView.prototype.get element): Deleted.
* Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendLocationLink):
(WI.ConsoleMessageView.prototype._appendStackTrace):
(WI.ConsoleMessageView.prototype._formatParameterAsString):
(WI.ConsoleMessageView.prototype._shouldShowStackTrace):
* Source/WebInspectorUI/UserInterface/Views/ErrorObjectView.js:
(WI.ErrorObjectView.prototype._buildStackTrace):
Drive-by: Change `new WI.StackTraceView` to just return the element to match `WI.CallFrameView`.

* Source/JavaScriptCore/CMakeLists.txt
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js:

* LayoutTests/inspector/animation/lifecycle-web-animation-expected.txt:
* LayoutTests/inspector/animation/resources/lifecycle-utilities.js:
(createAnimation):
(InspectorTest.AnimationLifecycleUtilities.awaitAnimationCreated):
* LayoutTests/inspector/canvas/resources/create-context-utilities.js:
(awaitCanvasAdded):
* LayoutTests/inspector/canvas/resources/recording-utilities.js:
(logRecording):
* LayoutTests/inspector/console/message-stack-trace-expected.txt:
* LayoutTests/inspector/console/resources/log-console-stack-trace.js:
(window.logConsoleMessageStackTrace):
* LayoutTests/inspector/debugger/continueUntilNextRunLoop.html:
* LayoutTests/inspector/debugger/evaluateOnCallFrame-CommandLineAPI.html:
* LayoutTests/inspector/debugger/paused-scopes.html:
* LayoutTests/inspector/debugger/resources/async-stack-trace-test.js:
(window.getAsyncStackTrace):
* LayoutTests/inspector/debugger/resources/log-active-stack-trace.js:
(window.getActiveStackTrace):
* LayoutTests/inspector/debugger/tail-deleted-frames-this-value.html:
* LayoutTests/inspector/debugger/tail-deleted-frames/resources/stack-trace-utilities.js:
(window.getAsyncStackTrace):
* LayoutTests/inspector/debugger/tail-recursion.html:
* LayoutTests/inspector/model/recording-expected.txt:
* LayoutTests/inspector/timeline/line-column-expected.txt:
* LayoutTests/inspector/worker/debugger-multiple-targets-pause.html:
* LayoutTests/platform/gtk/inspector/timeline/line-column-expected.txt:

Canonical link: https://commits.webkit.org/252630@main
  • Loading branch information
dcrousso committed Jul 20, 2022
1 parent 8c187ef commit 9b26fc6
Show file tree
Hide file tree
Showing 76 changed files with 781 additions and 534 deletions.
Expand Up @@ -8,7 +8,10 @@ Creating animation...

PASS: Animation created 'web-animation-test'.
0: animate - [native code]
1: createAnimation - inspector/animation/resources/lifecycle-utilities.js:7:35
1: (anonymous function) - inspector/animation/resources/lifecycle-utilities.js:8:39
---
0: setTimeout - [native code]
1: createAnimation - inspector/animation/resources/lifecycle-utilities.js:3:15
2: Global Code - [program code]
3: evaluateWithScopeExtension - [native code]
4: (anonymous function) - [native code]
Expand Down
55 changes: 35 additions & 20 deletions LayoutTests/inspector/animation/resources/lifecycle-utilities.js
@@ -1,15 +1,17 @@
window.animations = [];

function createAnimation(selector, keyframes = [], options = {}) {
let animation = null;
setTimeout(() => {
let animation = null;

let target = document.querySelector(selector);
if (target)
animation = target.animate(keyframes, options);
else
animation = new Animation(new KeyframeEffect(null, keyframes, options));
let target = document.querySelector(selector);
if (target)
animation = target.animate(keyframes, options);
else
animation = new Animation(new KeyframeEffect(null, keyframes, options));

window.animations.push(animation);
window.animations.push(animation);
});
}

function destroyAnimations() {
Expand Down Expand Up @@ -60,21 +62,34 @@ TestPage.registerInitializer(() => {

InspectorTest.pass(`Animation created '${animation.displayName}'.`);

for (let i = 0; i < animation.backtrace.length; ++i) {
let callFrame = animation.backtrace[i];
let traceText = ` ${i}: `;
traceText += callFrame.functionName || "(anonymous function)";

if (callFrame.nativeCode)
traceText += " - [native code]";
else if (callFrame.programCode)
traceText += " - [program code]";
else if (callFrame.sourceCodeLocation) {
let location = callFrame.sourceCodeLocation;
traceText += " - " + sanitizeURL(location.sourceCode.url) + `:${location.lineNumber}:${location.columnNumber}`;
let async = false;
let stackTrace = animation.stackTrace;
while (stackTrace) {
if (async)
InspectorTest.log(" ---");

for (let i = 0; i < stackTrace.callFrames.length; ++i) {
let callFrame = stackTrace.callFrames[i];
let traceText = ` ${i}: `;
traceText += callFrame.functionName || "(anonymous function)";

if (callFrame.nativeCode)
traceText += " - [native code]";
else if (callFrame.programCode)
traceText += " - [program code]";
else if (callFrame.sourceCodeLocation) {
let location = callFrame.sourceCodeLocation;
traceText += " - " + sanitizeURL(location.sourceCode.url) + `:${location.lineNumber}:${location.columnNumber}`;
}

InspectorTest.log(traceText);
}

InspectorTest.log(traceText);
if (stackTrace.truncated)
InspectorTest.log(" (truncated)");

stackTrace = stackTrace.parentStackTrace;
async = true;
}

InspectorTest.expectEqual(animation.animationType, animationType, `Animation type should be ${WI.Animation.displayNameForAnimationType(animationType)}.`);
Expand Down
Expand Up @@ -57,8 +57,9 @@ TestPage.registerInitializer(() => {
InspectorTest.expectEqual(canvas.contextType, contextType, `Canvas context should be ${contextDisplayName}.`);

let traceText = "";
for (let i = 0; i < canvas.backtrace.length; ++i) {
let callFrame = canvas.backtrace[i];
let callFrames = canvas?.stackTrace.callFrames ?? [];
for (let i = 0; i < callFrames.length; ++i) {
let callFrame = callFrames[i];
traceText += ` ${i}: ` + (callFrame.functionName || "(anonymous function)");
if (callFrame.nativeCode)
traceText += " - [native code]";
Expand Down
16 changes: 11 additions & 5 deletions LayoutTests/inspector/canvas/resources/recording-utilities.js
Expand Up @@ -67,13 +67,19 @@ TestPage.registerInitializer(() => {
lines.push(" swizzleTypes: [" + swizzleNames.join(", ") + "]");
}

if (action.trace.length) {
lines.push(" trace:");

for (let k = 0; k < action.trace.length; ++k) {
let functionName = action.trace[k].functionName || "(anonymous function)";
if (action.stackTrace?.callFrames.length) {
let line = " trace:";
if (action.stackTrace.truncated)
line += " (truncated)";
lines.push(line);

for (let k = 0; k < action.stackTrace.callFrames.length; ++k) {
let functionName = action.stackTrace.callFrames[k].functionName || "(anonymous function)";
lines.push(` ${k}: ` + functionName);
}

if (action.stackTrace.parentStackTrace)
lines.push(" (async)");
}

if (action.snapshot) {
Expand Down
19 changes: 19 additions & 0 deletions LayoutTests/inspector/console/message-stack-trace-expected.txt
Expand Up @@ -11,33 +11,52 @@ Test for the Console.stackTrace in different cases.
CALL STACK:
0: [F] (anonymous function)
1: [F] triggerConsoleTrace
ASYNC CALL STACK:
0: --- setTimeout ---
1: [P] Global Code

-- Running test case: Console.StackTrace.ConsoleError
CALL STACK:
0: [F] (anonymous function)
1: [F] triggerConsoleError
ASYNC CALL STACK:
0: --- setTimeout ---
1: [P] Global Code

-- Running test case: Console.StackTrace.UncaughtException
Uncaught exception in test page: TypeError: undefined is not an object (evaluating '[].x.x') [message-stack-trace.html:24]
CALL STACK:
0: [F] (anonymous function)
1: [F] triggerUncaughtException
ASYNC CALL STACK:
0: --- setTimeout ---
1: [P] Global Code

-- Running test case: Console.StackTrace.UnhandledPromiseRejection.PromiseReject
CALL STACK:
0: [N] (anonymous function)
1: [N] reject
2: [F] triggerUnhandledRejectionPromiseReject
ASYNC CALL STACK:
0: --- setTimeout ---
1: [P] Global Code

-- Running test case: Console.StackTrace.UnhandledPromiseRejection.ExplicitReject
CALL STACK:
0: [N] (anonymous function)
1: [F] (anonymous function)
2: [N] Promise
3: [F] triggerUnhandledRejectionExplicit
ASYNC CALL STACK:
0: --- setTimeout ---
1: [P] Global Code

-- Running test case: Console.StackTrace.UnhandledPromiseRejection.ImplicitReject
CALL STACK:
0: [F] (anonymous function)
1: [N] promiseReactionJob
ASYNC CALL STACK:
0: --- enqueueJob ---
1: [N] then
2: [F] triggerUnhandledRejectionImplicitWithException

Expand Up @@ -30,6 +30,7 @@ TestPage.registerInitializer(() => {
InspectorTest.log("ASYNC CALL STACK:");
foundAsyncBoundary = true;
}
callFrameIndex = 0;
logCallFrame(callFrames[0], true);
}

Expand Down
Expand Up @@ -20,7 +20,7 @@
{
function topCallFrameName() {
let targetData = WI.debuggerManager.dataForTarget(WI.mainTarget);
return targetData.callFrames[0].functionName;
return targetData.stackTrace.callFrames[0].functionName;
}

let suite = InspectorTest.createAsyncSuite("Debugger.continueUntilNextRunLoop");
Expand Down
Expand Up @@ -62,13 +62,13 @@

function testEvaluateOnNonStrictCallFrame(expression, callback) {
let targetData = WI.debuggerManager.dataForTarget(WI.debuggerManager.activeCallFrame.target);
let callFrame = targetData.callFrames[1]; // foo
let callFrame = targetData.stackTrace.callFrames[1]; // foo
testEvaluateOnCallFrame(callFrame, expression, callback);
}

function testEvaluateOnNonStrictCallFrameThrows(expression, callback) {
let targetData = WI.debuggerManager.dataForTarget(WI.debuggerManager.activeCallFrame.target);
let callFrame = targetData.callFrames[1]; // foo
let callFrame = targetData.stackTrace.callFrames[1]; // foo
testEvaluateOnCallFrameThrows(callFrame, expression, callback);
}

Expand All @@ -80,7 +80,7 @@
test(resolve, reject) {
let targetData = WI.debuggerManager.dataForTarget(WI.debuggerManager.activeCallFrame.target);
InspectorTest.expectThat(WI.debuggerManager.activeCallFrame.functionName === "bar", "Strict call frame is `bar`.");
InspectorTest.expectThat(targetData.callFrames[1].functionName === "foo", "Non-strict call frame is `foo`.");
InspectorTest.expectThat(targetData.stackTrace.callFrames[1].functionName === "foo", "Non-strict call frame is `foo`.");

testEvaluateOnStrictCallFrame("a", (x) => { InspectorTest.expectThat(x === 6, "`a` should be 5 in `bar`."); });
testEvaluateOnStrictCallFrame("b", (x) => { InspectorTest.expectThat(x === 123, "`b` should be 123 in `bar`."); });
Expand Down
2 changes: 1 addition & 1 deletion LayoutTests/inspector/debugger/paused-scopes.html
Expand Up @@ -73,7 +73,7 @@

function dumpCallFrames() {
let targetData = WI.debuggerManager.dataForTarget(WI.debuggerManager.activeCallFrame.target);
let callFrames = targetData.callFrames;
let callFrames = targetData.stackTrace.callFrames;
let chain = Promise.resolve();
for (let callFrame of callFrames)
chain = chain.then(() => dumpCallFrame(callFrame));
Expand Down
Expand Up @@ -9,7 +9,7 @@ TestPage.registerInitializer(() => {
if (!targetData)
return null;

return new WI.StackTrace(targetData.callFrames, {parentStackTrace: targetData.asyncStackTrace});
return targetData.stackTrace;
};

window.logAsyncStackTrace = function() {
Expand Down
Expand Up @@ -56,7 +56,7 @@ TestPage.registerInitializer(() => {
if (!targetData)
return null;

return new WI.StackTrace(targetData.callFrames, {parentStackTrace: targetData.asyncStackTrace});
return targetData.stackTrace;
}

window.logActiveStackTrace = function() {
Expand Down
Expand Up @@ -40,7 +40,7 @@
];

let targetData = WI.debuggerManager.dataForTarget(WI.debuggerManager.activeCallFrame.target);
let callFrames = targetData.callFrames;
let callFrames = targetData.stackTrace.callFrames;

InspectorTest.assert(callFrames.length >= expectedFrames.length, `Should have at least ${expectedFrames.length} frames, but have ${callFrames.length} instead.`);

Expand Down
Expand Up @@ -9,7 +9,7 @@ TestPage.registerInitializer(() => {
if (!targetData)
return null;

return new WI.StackTrace(targetData.callFrames, {parentStackTrace: targetData.asyncStackTrace});
return targetData.stackTrace;
};

window.logAsyncStackTrace = async function(options = {}) {
Expand Down
2 changes: 1 addition & 1 deletion LayoutTests/inspector/debugger/tail-recursion.html
Expand Up @@ -48,7 +48,7 @@
InspectorTest.log("------------------------------------");

let targetData = WI.debuggerManager.dataForTarget(WI.debuggerManager.activeCallFrame.target);
let callFrames = targetData.callFrames;
let callFrames = targetData.stackTrace.callFrames;

InspectorTest.assert(callFrames.length > numFramesToInspect); // We just look at top 50. This isn't a precise number. But it gets at the gist of the debugging experience.
for (let i = 0; i < numFramesToInspect; i++) {
Expand Down
2 changes: 1 addition & 1 deletion LayoutTests/inspector/model/recording-expected.txt
Expand Up @@ -109,7 +109,7 @@ WARN: Recording Warning: unknown type "test"
WARN: Recording Warning: non-number name
WARN: Recording Warning: non-array parameters
WARN: Recording Warning: non-array swizzleTypes
WARN: Recording Warning: non-number trace
WARN: Recording Warning: non-number stackTrace
{
"version": 1,
"type": "test",
Expand Down

0 comments on commit 9b26fc6

Please sign in to comment.