Proxy's optional target

Tom Van Cutsem tomvc.be at gmail.com
Tue Jan 15 12:47:12 PST 2013


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

> 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.

Cheers,
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130115/eea4a701/attachment-0001.html>


More information about the es-discuss mailing list