Catch-all proposal based on proxies

Mike Wilson mikewse at
Tue Dec 8 14:12:25 PST 2009

Tom Van Cutsem wrote:

On Tue, Dec 8, 2009 at 10:35 AM, Mike Wilson <mikewse at> wrote: 

A somewhat related example of the "world's choice" is how third-party
byte-code patching techniques have become the default choice in the Java
community, instead of the standard Java proxies (java.lang.reflect.Proxy),
which is a similar construct to the one proposed.

I cannot speak authoritatively about Java proxies, but one cause of this
evolution might be that Java Proxies only work for interface types.  

That certainly accounts for part of the loss in up-take, but not all I'd

Or are you seeing openings for syntactic sugar up the road, with classes

Syntactic sugar is always a possibility, but with the introduction of ES5's
Object.* meta-methods, I think many abstractions can be built on top of
proxies as plain library abstractions.

I'm guessing that a common use-case is trapping calls to all objects
delegating to a certain prototype, or all instances of a certain class. Do
you have any thoughts on how this may be optimized? When having 10000
objects to trap, it seems more efficient to put the catch-all on a single
augmentation point instead of creating and configuring 10000 proxies?
Best regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list