Most current Proxy-as-implemented test suite?
bruant.d at gmail.com
Wed May 1 14:17:17 PDT 2013
Le 01/05/2013 22:26, Kevin Reid a écrit :
> In Caja we have several uses for Proxies, some of which involve
> reimplementing or modifying the Proxy API.
Out of curiosity, how are you modifying it? for which use case?
> We are currently following
> the original harmony:proxies (rather than direct or notification
> proxies) since that's what is available in browsers.
Firefox implements and shipped direct proxies as part of Firefox 18 .
At this occasion, I moved the old proxy design MDN documentation in its
own page .
Last I heard, V8 was waiting on the spec to stabilize before moving
forward on implementation .
The API on the table for now is direct proxies. Notification proxies are
being discussed but haven't met consensus yet (are there news on this
If anything, I would recommend to move away from the initial proxy
design for Caja, because the harmony:proxies API is meant to never see
light in the spec (and should probably be removed from Firefox). Among
other things, harmony:proxies would have requires to ~double the memory
to check ES5 invariants regarding non-extensibility and
non-configurability. Direct proxies make the check on the target (and
make the forwarding proxy first-class which enables optimizations that
probably couldn't have been possible in the previous design).
Notification proxies guarantee the invariants by design, but force a
slightly different programming style.
Tom Van Cutsem wrote a direct proxies shim that runs on top of current
browser implementations . If you want to move to direct proxies, it
might be something to consider.
> What is the most current test suite available for this variant of proxies? So far I have found <http://hg.ecmascript.org/tests/harmony/>, which seems to be a more
> recent version of what we are currently using, but has it been
> superseded by something else?
I have started an unofficial test suite for direct proxies . It's
incomplete, but if you want to move to direct proxies, that would be a
good start I guess. Review the tests before fully trusting them, so far
it's been only me working on that.
More information about the es-discuss