__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 (
> with `isCall' flag for `get', I was showing a similar example with
> `__noSuchProperty__' and `__noSuchMethod__' (
> 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 ;-)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss