proxies v2 proposal

Tom Van Cutsem tomvc at
Tue Dec 22 14:41:46 PST 2009


We wrapped up our second iteration over the catch-all proposal and migrated
it back to its original page:

The changes between v1 and v2 in a nutshell: in this iteration, we allow
proxies to also trap the methods defined on "Object", such as
"Object.getOwnPropertyDescriptor". In v1, these methods exposed proxies as
empty objects to user code. In v2, the proxy can trap all
object-interaction, enabling it to fully emulate regular objects.

In principle, user code can only distinguish between trapping proxies and
regular objects by means of the provided built-in method
"Proxy.isTrapping(obj)" method. This makes it easy to reintroduce the v1
semantics using v2 proxies, as shown here: <

We also added a new example that shows how catch-alls can be used to
implement higher-order messages:


On Mon, Dec 14, 2009 at 6:56 PM, Brendan Eich <brendan at> wrote:

> Link is:
> Please feel free to overwrite the original proposal with this page's
> wiki-contents and remove the v2 page (by removing its contents).
> One comment: I don't see a response to the order-of-evaluation question in
> comment 4 of:
> /be
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list