Catch-all proposal based on proxies

Tom Van Cutsem tomvc at google.com
Mon Dec 7 16:47:46 PST 2009


Somebody asked me what the main differences are w.r.t. the existing
catch-all proposal:

The main similarity: like the existing catch-all proposal, our proxy
proposal separates the traps from the object being trapped (i.e. both
propose the use of a separate "handler" object).

The main difference: the proxy proposal only enables catch-alls for special,
empty "proxy" objects. In the existing catch-all proposal, there is still
the notion of "activating" or "deactivating" catch-alls on existing objects,
which leads to issues such as whether or not the catch-all should trigger on
existing properties. Also, from a security POV this has the bad property
that any object that has a reference to an object can all of a sudden decide
to take control over the behavior of that object. Our proxy proposal does
not allow this.

The other main difference is that the proxy proposal details how proxies
interact with the new ES5 concepts of "frozen", "sealed" and
"non-extensible" objects, and with a host of other language features (e.g.
instanceof, ===, typeof, the Object.* introspection methods, ...)

Cheers,
Tom

On Mon, Dec 7, 2009 at 4:11 PM, Tom Van Cutsem <tomvc at google.com> wrote:

> Dear all,
>
> Over the past few weeks, MarkM and myself have been working on a proposal
> for catch-alls for ES-Harmony based on proxies. I just uploaded a strawman
> proposal to the wiki:
>
> http://wiki.ecmascript.org/doku.php?id=strawman:proxies
>
> Any feedback is more than welcome. Note that the proposal is quite lengthy,
> which is mostly due to the fact that it also includes a detailed semantic
> specification of proxies (in ES5-spec-style) in addition to just its API
> description. If you're not interested in the specification details, you can
> skip the section named "Semantics".
>
> Cheers,
> Tom
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20091207/35854c54/attachment.html>


More information about the es-discuss mailing list