Closed Bug 1906587 Opened 4 months ago Closed 3 months ago

Preview tooltip doesn't work on expression `this[x].y`

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(firefox130 fixed)

RESOLVED FIXED
130 Branch
Tracking Status
firefox130 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Steps to reproduce

  1. Open the console
  2. Evaluate the following expression
new(class {
  constructor() {
    this.x = {
      y: 42
    };
    const prop = "x";
    this[prop].y;
    debugger;
  }
});
  1. Once the debugger is opened, hover y in the this[prop].y line

Expected results

The preview tooltip is displayed, with the expected value, 42

Actual results

The preview tooltip isn't displayed.
In stdout, I can see the following error: Preview for <this.[name].value> threw a SyntaxError

Notice the . before [name], which explains the syntax error

Let's at least add a test here to make sure this gets fixed when migrating to codemirror.

Blocks: 1773246
Severity: -- → S3
Priority: -- → P2
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e7ab50577b53 [devtools] Fix preview for this property access with bracket notation. r=devtools-reviewers,ochameau.
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: