Fix deep object inspection in the script debugger

RESOLVED FIXED

Status

()

Firefox
Developer Tools: Debugger
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: past, Assigned: past)

Tracking

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 4 obsolete attachments)

The script debugger after bug 694538 allows the inspection of objects like 'this', __proto__, etc., albeit only one-level deep. After bug 699419 is done, object inspection should be fixed to work as expected.
Depends on: 694538
Blocks: 697761
Created attachment 574568 [details] [diff] [review]
WIP

This is my WIP. Running it on htmlpad.org/debugger I get the following error when I try to inspect the "this" object:

DBG-CLIENT: Error handling response: TypeError: aVar.addProperties is not a function - SF_addExpander([object Object],[object Proxy])@chrome://browser/content/debugger.js:263
([object Proxy])@chrome://browser/content/debugger.js:293
([object Proxy])@resource:///modules/dbg-client.jsm:736
DC_onPacket([object Proxy])@resource:///modules/dbg-client.jsm:370

Commenting out lines 294 and 299 should make the errors disappear, along with deep object inspection.
Assignee: nobody → past
Status: NEW → ASSIGNED
Attachment #574568 - Flags: feedback?(vporof)
Comment on attachment 574568 [details] [diff] [review]
WIP

Review of attachment 574568 [details] [diff] [review]:
-----------------------------------------------------------------

You were trying to call addProperties from a property descriptor.
Created attachment 574588 [details] [diff] [review]
WIP fix
Attachment #574588 - Flags: feedback?(past)
Created attachment 574604 [details] [diff] [review]
Working patch

Fixed the frame.arguments and __proto__ breakage, as well as a few more corer cases that I've hit: prototypes for wrapped natives and property grips having hasOwnProperty defined. It's just missing a few tests.
Attachment #574568 - Attachment is obsolete: true
Attachment #574588 - Attachment is obsolete: true
Attachment #574568 - Flags: feedback?(vporof)
Attachment #574588 - Flags: feedback?(past)
Created attachment 574895 [details] [diff] [review]
Working patch v2

Added tests for making sure expanding an object retrieves its properties, and made a couple of small changes requested in bug 694538 comment 5 and bug 695279 comment 7.
Attachment #574604 - Attachment is obsolete: true
Attachment #574895 - Flags: review?(dcamp)
Created attachment 575123 [details] [diff] [review]
Working patch v3

Made another simplification requested in bug 694538 comment 8.
Attachment #574895 - Attachment is obsolete: true
Attachment #574895 - Flags: review?(dcamp)
Attachment #575123 - Flags: review?(dcamp)

Updated

6 years ago
Attachment #575123 - Flags: review?(dcamp) → review+
Component: Developer Tools → Developer Tools: Debugger
QA Contact: developer.tools → developer.tools.debugger
https://hg.mozilla.org/users/dcamp_campd.org/remote-debug/rev/be56b2aa2541
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.