Closed Bug 830822 Opened 11 years ago Closed 5 years ago

Implement backend support for forcing evaluation on untrusted getter properties

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: vporof, Unassigned)

References

Details

      No description provided.
See bug 820878.
We should also make sure that setting a new value for the getter, and also for the value itself (after forcing evaluation) works property when clientEvaluating.
Assignee: nobody → past
Status: NEW → ASSIGNED
Priority: -- → P2
Blocks: 820878
bumping this to P1. Blocking Mihai's work on integrating the VariablesView in the WebConsole.
bug 808370.
No longer blocks: 820878
Priority: P2 → P1
Blocks: 820878
(In reply to Victor Porof [:vp] from comment #2)
> We should also make sure that setting a new value for the getter, and also
> for the value itself (after forcing evaluation) works property when
> clientEvaluating.

Setting a new getter value (as in: function) works properly since bug 831794.

Changing the value force-returned by the getter (essentially turning the whole property itself into a plain value property) needs a bit of special-casing (since the "value" node is not a real property itself, just like "get" and "set"), but the heavy lifting was also done in bug 831794. Bug 820878 will take care of the UI.
(In reply to Victor Porof [:vp] from comment #4)
> Changing the value force-returned by the getter (essentially turning the
> whole property itself into a plain value property)

Or not. That's probably not the behavior one would look for. See https://bugzilla.mozilla.org/show_bug.cgi?id=820878#c7.

Anyway, special casing the "value" node is still required, because we wouldn't want to eval("myVal.getterSetterProperty.value = 42"). Other than that, I'm pretty optimistic that there won't be any complications with setters.
Lowering priority to reflect reality, as this didn't actually block the integration of the VariablesView to the web console.
Priority: P1 → P2
Not going to work on this soon.
Assignee: past → nobody
Status: ASSIGNED → NEW
Flags: firefox-backlog-
I don't understand the purpose of this bug. Could you clarify a bit Victor?
Flags: needinfo?(vporof)
Untrusted (non-system) getters appear as functions. Sometimes in our debugging endeavors we're interested in the value returned by said getter, not the getter function. Providing a mechanism to evaluate those getters on demand is necessary.
Flags: needinfo?(vporof)
I don't understand this bug either. I've just tried to write a demo to explore what the current implementation does in the context of bug 967853, and it seems to me the problem is the opposite: the debugger evaluates getters all the time, and it would probably be a good idea to give the developer using the debugger more control. See http://hallvord.com/temp/moz/dbg-getter.htm for a demo.

(It's a hard problem - Chrome devtools and Opera Dragonfly fail that test too.)
Flags: needinfo?(vporof)
Getters are evaluated for tooltips when hovering. They're not evaluated in the sidebar variable view when inspecting scopes.
Flags: needinfo?(vporof)
Ah - thanks. I see. IMO this should be unified so page-defined getter properties appear the same way in all contexts. Preferably in a way you can both inspect the code of the getter and choose to run it and see the result. I think Chrome devtools was experimenting with something like [...] in the UI.
The code is here: https://dxr.mozilla.org/mozilla-central/source/devtools/server/actors/object.js#457

I think it would be safe to return a value field in that function that evaluates the getter.
Product: Firefox → DevTools
No longer blocks: 820878

I believe this is done.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.