2011/12/17 David Bruant <[email protected]>

> I don't think that the default you propose are a good idea, because it
> will make bugs harder to track. Object.getOwnPropertyDescriptor
> returning 'undefined' for any property does not sound like a good idea.
> Likewise for Object.getOwnPropertyNames returning [] systematically.
>

That is indeed a concern. Abstract methods err on the side of safety.
Default behaviors can turn against you if they don't do what you expected.


> Another idea would be to have no default for virtual handler fundamental
> trap and that the fundamental traps are the default direct proxies traps
> (forwarding to the target).
>

I don't agree here: the VirtualHandler is designed to support proxy
abstractions that explicitly do not want to "use" their target object, i.e.
they want to ignore the target object as much as possible. VirtualHandlers
are for creating virtual objects (for instance, a remote object proxy for
which there is no real physical target object acting as a backing store).

Indeed, the reason why the VirtualHandler implements the entire handler
API, "overriding" all the default trap behavior, is precisely to avoid
falling back to forwarding to the target.

Cheers,
Tom
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to