Open Bug 952093 Opened 11 years ago Updated 2 years ago

Debugger cannot inspect XPCWrappedNatives (i.e. Components.utils)

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: msucan, Unassigned)

References

(Blocks 1 open bug)

Details

(followup from bug 843004 comment 78)

Given a Debugger.Object, calling getOwnPropertyNames() can throw "Cannot modify properties of a WrappedNative". This happens when inspecting Components.utils in the Browser Console.

(maybe related to bug 560072)
The gist of it is that bug 560072 fixed things for anything that got quickstubbed.  And these days, anything that's WebIDL has that fixed naturally.

But things in the old XPCOM world, that go through XPConnect for JS-to-C++ and vice versa marshalling, weren't fixed by either of those developments.  I'm not sure how well the getter/setter-as-function techniques used by those other fixes, that are required to fix this, can be made to work on XPConnect given how it's designed.  But something may be possible.
Thanks for the background. Perhaps Bobby can comment on the feasibility of fixing this?
It would probably a be a fair amount of work. We would basically need to apply the machinery from bug 560072 (much of which appears to have been removed at some point, but I can't find the bug where it happened) to all XPCWrappedNatives.

I think it probably makes sense just to engineer a more helpful error message ("Can't perform introspection on an XPCWrappedNative") and be done with it.
Priority: -- → P3
Summary: Debugger obj.getOwnPropertyNames() throws for Components.utils → Debugger cannot inspect XPCWrappedNatives (i.e. Components.utils)
Product: Firefox → DevTools
Blocks: dbg-api
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.