Proxy's optional target

Tom Van Cutsem at
Tue Jan 15 12:47:12 PST 2013

2013/1/15 Dmitry Soshnikov <dmitry.soshnikov at>

> Sure, and it (the target) still would be there, just created implicitly.
> All the invariants are kept, the storage (the implicit target) is kept.
> But, that's mentioned, if the target is implicit, then handler functions
> look a bit weird when receive it as the first argument.

I see your point, but would argue to always have the target be created
explicitly. Implicitly creating objects behind the programmer's back just
feels awkward, especially if this object is then exposed to handler
functions as first argument (as you note).

Put another way, writing new Proxy({} , handler) more explicitly alerts the
reader about what's going on.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list