[[Invoke]] and implicit method calls

Till Schneidereit till at tillschneidereit.net
Thu Sep 12 06:02:29 PDT 2013


On Thu, Sep 12, 2013 at 2:35 PM, Tom Van Cutsem <tomvc.be at gmail.com> wrote:

> 2013/9/12 Till Schneidereit <till at tillschneidereit.net>
>
>> I agree, anything else would be surprising. But can't we make the .invoke
>> trap work for both [[Invoke]] and [[InvokeConditional]]? It would just
>> always be called, and the places where [[InvokeConditional]] is used in the
>> spec would treat it as though the required method exists on the receiver.
>>
>
> I don't understand. Could you expand? If Proxy.[[InvokeConditional]]
> triggers the "invoke" trap, presumably the trap still needs to somehow
> signal "the property wasn't callable"?
>

That latter assumption is exactly the one I wasn't sure about. Implementing
the invoke trap could mean that you just trap all method calls, instead. On
the surface, that seems like a fairly consistent assumption and prevents
the inter-trap dependencies.

However, your argument that those dependencies aren't really anything new
and most users should work with the virtual object api instead of fully
implementing proxies on their own convinced me that giving up on
[[InvokeConditional]] support in proxies isn't the right trade-off.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130912/66710218/attachment-0001.html>


More information about the es-discuss mailing list