Closed Bug 1876297 Opened 9 months ago Closed 8 months ago

Debugger preview popup evaluates `values` as the console helper, not the actual value

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(firefox-esr115 unaffected, firefox122 wontfix, firefox123 wontfix, firefox124 fixed)

RESOLVED FIXED
124 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox122 --- wontfix
firefox123 --- wontfix
firefox124 --- fixed

People

(Reporter: nchevobbe, Assigned: ochameau)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Steps to reproduce

  1. Navigate to data:text/html,<meta charset=utf8><script>const values = [1,2,3]; debugger</script>
  2. Open the debugger
  3. Reload the page, the debugger should pause
  4. In the opened source, hover values

Expected results

The preview shows that it's an array

Actual results

The preview says that values is a function, which makes me think it returned the console helper (I'm seeing the same issue with $, which is another console helper)

Severity: -- → S3
Flags: needinfo?(poirot.alex)
Priority: -- → P2

It was probably meant to be handled by the useInnerBindings flag:
https://searchfox.org/mozilla-central/rev/2c3d657cbba5484ccac44443c4417baed7b5fafb/devtools/server/actors/webconsole/eval-with-debugger.js#203-207
So either we aren't setting this flag, or it doesn't work as expected?

See Also: → 1876696

Looks like this was regressed by Bug 1847222

Keywords: regression
Regressed by: 1847222

Set release status flags based on info from the regressing bug 1847222

We can't strictly rely on the existing disableBreaks attribute.
We should probably have a new RDP attribute to distinguish frontend evaluation involving console commands.
Only them should enforce overriding local symbols in scope with the console commands.

Flags: needinfo?(poirot.alex)
Assignee: nobody → poirot.alex

We should probably expose new RDP methods to prevent relying on console evaluations for this.
We would still have some potential issues if the evaluated method is about a JS symbol
whose name is the console command.

Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4d57b721b460 [devtools] Only force overiding local scope variables for frontend commands relying on console commands. r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch

The patch landed in nightly and beta is affected.
:ochameau, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox123 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(poirot.alex)
Flags: needinfo?(poirot.alex)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: