Closed Bug 1767213 Opened 7 months ago Closed 2 months ago

Autcomplete `this.` shows results for global object

Categories

(DevTools :: Console, defect, P2)

Firefox 101
defect

Tracking

(firefox-esr102 wontfix, firefox106 wontfix, firefox107 verified, firefox108 verified)

VERIFIED FIXED
107 Branch
Tracking Status
firefox-esr102 --- wontfix
firefox106 --- wontfix
firefox107 --- verified
firefox108 --- verified

People

(Reporter: wartmanm, Assigned: wartmanm)

Details

Attachments

(1 file)

Steps to reproduce:

const obj = {
    a: 1,
    b: 2,
    sum() {
        debugger;
        return this.a + this.b;
    }
};

While paused in obj.sum(), enter "this.a" in the console.

Actual results:

The autocomplete prompt shows "addEventListener", "alert", etc.

Expected results:

The autocomplete prompt should show the property "a".

This is pretty minor but it also looks like a small fix - passing frameActorId from autocomplete() through JSPropertyProvider() to evalWithDebugger(). I'd be happy to work on it.

The Bugbug bot thinks this bug should belong to the 'DevTools::Console' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Console
Product: Firefox → DevTools

Thanks for reporting and offering help Matthew
Do you want me to assign the bug to you?

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P2

Yes, please.
Sorry for disappearing for 5 months

Assignee: nobody → wartmanm
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1ce1fc25ab48
JSPropertyProvider should use current stackframe for eager evaluation r=nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 107 Branch
Flags: qe-verify+

Hi Matthew, I tried to verify this fix in our latest Nightly build 108.0a1 (2022-10-20) by simply opening Console in Dev Tools and pasting the following code:

const obj = {
a: 1,
b: 2,
sum() {
debugger;
return this.a + this.b;
}
};

After hitting Enter and typing "this.a" on the next line we are still getting the addEventListener and Alert autocomplete dropdown list. Are these not the correct steps ?

Flags: needinfo?(wartmanm)

After entering that snippet you have to run obj.sum(). Once it pauses in the debugger, typing this.a should show the expected autocomplete results. Sorry for the unclear directions!

Flags: needinfo?(wartmanm)

Thanks for the extra Info Matthew, This issue is verified as fixed in our latest Nightly build as well as our latest Beta 107.0b2, I will updated the flags for Release and ESR since the issue still occurs in those versions.

Updating the Flags for this issue to Verified.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.