proxies v2 proposal

# Brendan Eich (16 years ago)

Link is:

strawman:proxiesv2

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:

esdiscuss/2009-December/010308

# Brendan Eich (16 years ago)

Link is:

strawman:proxiesv2

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:

esdiscuss/2009-December/010308

# Mark S. Miller (16 years ago)

Ohhh nooo.

Tom and I were working on this as a draft to try out some speculative ideas. We hadn't placed a link to it yet because we weren't yet to propose it. But glad you like the direction! Please don't spend time on it though until we have it in a more coherent shape.

# Tom Van Cutsem (16 years ago)

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

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: < strawman:proxies#interaction_with_object._introspective_api

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