Closed Bug 1932021 Opened 9 months ago Closed 6 months ago

Hovering over a function in minified source doesn't let you navigate to the destination

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(firefox137 fixed)

RESOLVED FIXED
137 Branch
Tracking Status
firefox137 --- fixed

People

(Reporter: jrmuizel, Assigned: ochameau)

References

(Depends on 1 open bug, Blocks 1 open bug, )

Details

Attachments

(1 file)

STR:

<script src=scope.js></script>

scope.js:

var o=f();o.inc();o.m();console.log(o.get());function f(){var p=0;var k=5;return{inc:function(){p++},get:function(){return p},m:function(){console.log("fod")}}}

Load the above and unminify the js source. Set the debugger to break on the first line o=f(). Hover over f and then click on 'go to function' button. It doesn't navigate or highlight f in yellow.

If scope.js isn't minified in the first place it works fine.

Bomsy built a test page for this bug: https://bug-1932021.glitch.me/

Evaluating f in the console and jumping to definition from there actually works, so it should be feasible to fix this in the debugger.
Note that jump to definition in the debugger seems flaky and doesn't always work, might not be only about unminified files.

Severity: -- → S3
Priority: -- → P3

I'm having some more general fixes around pretty print to land first in bug 1917012.

Depends on: 1917012

I've found another case where the jump-to-definition button doesn't work:

<script>
function f() {}
const x = { f };
debugger;
</script>

if you debug this file and hover over f then the jump-to-definition button works but if you hover over x then the jump-to-definition button for the f property doesn't work.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d94b7377fdfe [devtools] Fix navigating to pretty print sources from debugger previews. r=devtools-reviewers,bomsy
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch
See Also: → 1947692
Regressions: 1947725
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: