Closed Bug 889198 Opened 11 years ago Closed 11 years ago

Can't set __proto__ on DOM proxies


(Core :: JavaScript Engine, defect)

Not set





(Reporter: bzbarsky, Assigned: efaust)




(Whiteboard: [qa-])

See bug 694775 comment 4 and following.

Jeff, see bug 694775 comment 11 in particular.
Flags: needinfo?(jwalden+bmo)
Blocks: 694775
Yeah, I don't understand how this is supposed to work. We need to implement nativeCall and then detect TestProtoSetterThis and ProtoSetterImpl and call our own instead? And then we need to reimplement whatever checks the engine is doing in those? That seem pretty brittle.
Why exactly can't the engine do this itself? It knows exactly where the proto object is stored in the proxy object after all.
There's an argument that nativeCall is not well-adapted to this problem, certainly.  In the original case, it made plenty of sense in that it meant that all proxy objects, that weren't recognized by the setter function as acceptable this-values, would be rejected.  Generally there weren't many proxies that *wanted* settable protos, tho, so that part was perhaps somewhat vague.

Probably what's most desirable here is making the prototype part of the proxy API, as in the getInheritance/setInheritance stuff from the latest ES6 drafts.  That would make very clear to proxies how they could implement prototypy stuff.
Flags: needinfo?(jwalden+bmo)
Eric, do you have the bandwidth to maybe look into this?
Assignee: nobody → general
Component: DOM → JavaScript Engine
Flags: needinfo?(efaustbmo)
Depends on: 888969
Depends on: 926012
This should just be fixed when 926012 lands. It no longer relies on implementing the extra machinery. If we want a backport, we can do that much more simply, but we wanted to take a step forward as we did this.
No longer depends on: 888969
Flags: needinfo?(efaustbmo)
Fixed by the patch in bug 926012.
Assignee: general → efaustbmo
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.