[Harmony Proxies] On property descriptor auto-completion in defineProperty/get{Own}PropertyDescriptor traps (derived from: [Harmony Proxies] Proposal: Property fixing)

David Bruant david.bruant at labri.fr
Mon May 9 11:53:34 PDT 2011


Le 09/05/2011 17:50, Tom Van Cutsem a écrit :
>
>     Going in the direction you're describing would open the door for a
>     Object.getPrototypeOf trap (which I'm fine with).
>
>     David
>
>
> How exactly would Allen's suggestion of relaxing the fix
> trap/configurable constraints open the door for supporting mutable
> prototypes via a getPrototypeOf trap? I must be missing something.
Allen's last paragraph was more general than relaxing the fix
trap/configurable constraints (at least that's how I understand it).

Allen wrote:
> I don't believe that guaranteeing these invariants  is important enough to for Proxies to be unusable for their primary use case of replacing/emulating built-in and host objects.
One could imagine a buggy Object.getPrototypeOf on an host object
(consecutive calls returning different objects, for instance). Will a
proxy for which Object.getPrototypeOf is not trappable be able to
replace/emulate all cases?
I admit that it is a bit hard to imagine, but in all rigour, there is no
reason to think the prototype to be bug-free in all implementations
(those which implement __proto__ in first line).
Actually, a writable __proto__ could be implemented (I don't discuss now
if it's a good thing) with an Object.getPrototypeOf trap. Couldn't be
without.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110509/9136d6ce/attachment.html>


More information about the es-discuss mailing list