Skip to content

Commit

Permalink
Bug 1884717 - [devtools] Only log "returns" when logging exit frames …
Browse files Browse the repository at this point in the history
…without tracing values. r=devtools-reviewers,bomsy

We were logging "returns undefined" everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D204301
  • Loading branch information
ochameau committed Mar 13, 2024
1 parent fac318f commit 6f71357
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,11 @@ function JSTracerTrace(props) {
if (why) {
messageBody.push(
// Add a spaces in order to improve copy paste rendering
dom.span({ className: "jstracer-exit-frame-reason" }, " " + why + " "),
formatRep(messageBodyConfig, returnedValue)
dom.span({ className: "jstracer-exit-frame-reason" }, " " + why + " ")
);
if (returnedValue !== undefined) {
messageBody.push(formatRep(messageBodyConfig, returnedValue));
}
}

if (prefix) {
Expand Down
8 changes: 4 additions & 4 deletions devtools/client/webconsole/utils/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ function transformTraceResource(traceResource) {
args,
sourceId,

returnedValue,
relatedTraceId,
why,

Expand All @@ -411,9 +410,10 @@ function transformTraceResource(traceResource) {
parameters: args
? args.map(p => (p ? getAdHocFrontOrPrimitiveGrip(p, targetFront) : p))
: null,
returnedValue: why
? getAdHocFrontOrPrimitiveGrip(returnedValue, targetFront)
: null,
returnedValue:
why && "returnedValue" in traceResource
? getAdHocFrontOrPrimitiveGrip(traceResource.returnedValue, targetFront)
: undefined,
relatedTraceId,
why,
messageText: null,
Expand Down

0 comments on commit 6f71357

Please sign in to comment.