[[Invoke]] and implicit method calls

Mark S. Miller erights at google.com
Tue Sep 24 10:06:32 PDT 2013

I do not know and I do not know what to search on to find out. However, I
would guess it is used enough to be a real concern. We documented it at <
for reasons that are not Caja specific. That page followed from Axel's <
http://www.2ality.com/2011/11/uncurrying-this.html> which is also not Caja
specific. Both have been public advice posted in places prominent to the JS
community for a long time. There was also an earlier discussion on
es-discuss about exactly this integrity issue, that was again not Caja

But anyway, another point of my email is that I don't understand what
problem you're trying to solve. The reason for using this pattern, rather
than the much simpler thing.f(...args) is to take control away from thing.
If you give control back to thing anyway, what's the point? If you want
thing to have control, why not write thing.f(...args) ?

On Tue, Sep 24, 2013 at 9:47 AM, Allen Wirfs-Brock <allen at wirfs-brock.com>wrote:

> On Sep 24, 2013, at 7:37 AM, Mark S. Miller wrote:
> Thanks to André and Tom, I think I now understand the problem. I think the
> only solution lies in this comment from Tom:
> On Tue, Sep 24, 2013 at 1:23 AM, Tom Van Cutsem <tomvc.be at gmail.com>wrote:
>> [...] The generic solution is membranes. Anything else needs
>> application-specific consideration.
> But right above it he says
> To solve all of that, you'd need proper membranes. But using membranes to
>> fix the this-rebinding problem seems like total overkill.
> A solution that works is better than one that doesn't. We always knew that
> patterns of proxies short of membranes would have abstraction leakage. This
> is one. What is wrong with the stance: Live with it or use membranes,
> In answer to Tom's later question, Caja code does use the pattern
>     f.call(thing);
> a lot. Or even
> Mark,
> In the wild, how often do you think F.p.call is used with these sorts of
> integrity guarantees in mind?  Does anybody other than Caja do it?   If we
> are really only talking about Caja, it presumably could adapt to using
> Reflect.apply.
> Allen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130924/9fd041ef/attachment-0001.html>

More information about the es-discuss mailing list