__noSuchMethod__ and direct proxies

Tom Van Cutsem tomvc.be at gmail.com
Mon Dec 5 04:05:14 PST 2011


2011/12/5 Dmitry Soshnikov <dmitry.soshnikov at gmail.com>

> Just a note. Seems we're going to back to the unstratified API? When long
> time ago in that long thread (
> https://mail.mozilla.org/pipermail/es-discuss/2010-October/011912.html)
> with `isCall' flag for `get', I was showing a similar example with
> `__noSuchProperty__' and `__noSuchMethod__' (
> https://github.com/DmitrySoshnikov/es-laboratory/blob/master/examples/noSuchMethod.js),
> you were against such __magicAssignments__ to objects. Though, in my case
> those were proxies, created by alternative protocol: `Object.new'.
>

Just to make sure I am not misunderstood: no, "we" are not going back to
the unstratified API!

__noSuchMethod__ remains as unstratified as it ever was. I maintain that
the stratified Proxy API is safer than __noSuchMethod__. The above was
simply an answer to the question as to whether proxies might provide a way
to support __noSuchMethod__ without turning your object into a proxy. They
do, but that doesn't make __noSuchMethod__ any more principled.

So, FTR, I still prefer using a proxy with a |get| trap over a
__noSuchMethod__ hook ;-)

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


More information about the es-discuss mailing list