Yehuda Katz wrote:
On Wed, Oct 24, 2012 at 5:16 PM, Andrea Giammarchi <[email protected] <mailto:[email protected]>> wrote:

    But then why such "encouragement"
    https://brendaneich.com/2012/10/harmony-of-dreams-come-true/ ? (
    Proxy paragraph )

    If __noSuchMethod__ is wrong, what's the point of suggesting a way
    to simulate it through proxies?


__noSuchMethod__ isn't the same problem as my concern about invoke-only traps. In this case, (x = sink.bar).apply(sink) would still hit the __noSuchMethod__ method.

That's right.

Andrea, please see especially this part of the blog post you cited:

"""
This implementation does not just call the |__noSuchMethod__| hook when a missing method is invoked, as shown after the |obj.bar()| line above. It also creates a thunk for any |get| of a property not in the target object and not in |Object.prototype|:

|js>  obj.bar
(function  (...args)  {
      return  receiver.__noSuchMethod__(name,  args);
    })
js>  var  thunk=  obj.bar
js>  thunk()
"bar"|

I think this is an improvement on my original <https://bugzilla.mozilla.org/show_bug.cgi?id=196097> |__noSuchMethod__| creation all those years ago in SpiderMonkey.
"""

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to