Closed Bug 1513505 Opened 6 years ago Closed 6 years ago

Invoking prototype getter's property does not work if getter accesses property set on the end object

Categories

(DevTools :: Console, defect, P1)

65 Branch
defect

Tracking

(firefox-esr60 unaffected, firefox64 unaffected, firefox65 verified, firefox66 verified)

VERIFIED FIXED
Firefox 66
Tracking Status
firefox-esr60 --- unaffected
firefox64 --- unaffected
firefox65 --- verified
firefox66 --- verified

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

Details

(Keywords: regression)

Attachments

(1 file)

**Steps to reproduce** 1. Evaluate the following: ```js class C { constructor() { this.obj = { prop: "prop" }; } get someGetter() { return this.obj.prop; } } new C ``` 2. Expand `obj`, then `<prototype>` 3. `someGetter` node should be visible, click it **Expected results** `someGetter` changes to show "prop" **Actual results** There's an error displayed next to the label: `TypeError: "this.obj is undefined; can't access its "prop" property"` --- Actual fix will be done in https://github.com/devtools-html/debugger.html/pull/7484. This bug will be used to land the bug, add a test, and trying to uplift the fix to beta since Bug 820878 rid the train.
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Priority: -- → P1
This lands the fix done in the debugger Reps for ObjectInspector (https://github.com/devtools-html/debugger.html/pull/7484\), and add a test to ensure we don't regress this. We take this as an opportunity to put some object inspector helpers in head.js so we don't repeat ourselves too much.
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7e17aa956dc6 Fix invoke getter on prototype's property; r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 66
Comment on attachment 9030670 [details] Bug 1513505 - Fix invoke getter on prototype's property; r=jdescottes. [Beta/Release Uplift Approval Request] Feature/Bug causing the regression: Bug 820878 User impact if declined: The invoke getter button will give an erroneous result to the user if it is a prototype property that uses a property access set on an upper object. This is bad because we introduced this new feature of getting a getter value for 65, and we don't want to confuse the user with wrong results. Is this code covered by automated tests?: Yes Has the fix been verified in Nightly?: Yes Needs manual test from QE?: Yes If yes, steps to reproduce: 1. Evaluate the following: ```js class C { constructor() { this.obj = { prop: "prop" }; } get someGetter() { return this.obj.prop; } } new C ``` 2. Expand `obj`, then `<prototype>` 3. `someGetter` node should be visible, click it **Expected results** `someGetter` changes to show "prop" **Actual results** There's an error displayed next to the label: `TypeError: "this.obj is undefined; can't access its "prop" property"` List of other uplifts needed: None Risk to taking this patch: Low Why is the change risky/not risky? (and alternatives if risky): Devtools change only, for getters only, covered by a test. String changes made/needed:
Attachment #9030670 - Flags: approval-mozilla-beta?
Blocks: 820878
No longer depends on: 820878
Flags: qe-verify+
Flags: in-testsuite+
Keywords: regression
Comment on attachment 9030670 [details] Bug 1513505 - Fix invoke getter on prototype's property; r=jdescottes. [Triage Comment] This patch looks scary-big, though I guess it's mostly generated code. That said, it's still pretty difficult to reason about what this patch is doing. Taking it for 65.0b5 while we're still early in the cycle, but we should plan to get some QA testing around this to ensure that everything behaves correctly still.
Attachment #9030670 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
I successfully reproduced the issue on Firefox Nightly 66.0a1 (2018-12-12) under Windows 10 (x64) with help from Nicolas and STR from Comment 0. The issue is no longer reproducible on Firefox Beta 65.0b5 (20181216183345) and latest Firefox Nightly 66.0a1 (2018-12-17) under Windows 10 (x64), Ubuntu 16.04 (x86) and macOS 10.12.
Status: RESOLVED → VERIFIED
Flags: qe-verify+
Depends on: 1515046
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: