[[Invoke]] and implicit method calls

Tom Van Cutsem tomvc.be at gmail.com
Thu Sep 12 04:31:51 PDT 2013

2013/9/11 Brendan Eich <brendan at mozilla.com>

> 3) For proxy trap invocations I maintain we are still better off with
>> [[Get]] + [[Call]] to keep double-lifting as simple as possible.
> Sorry if I missed it: what complicates things if we use [[Invoke]] to
> support double-lifting?

Trap method calls on the handler are conditional: if the handler doesn't
implement a trap, the proxy will forward to the target instead.

Currently we call handler.[[Get]] + verify whether the result is
callable. In the case of double-lifting, this means the meta-handler only
has to implement the "get" trap.

If we would have a hypothetical [[ConditionalInvoke]] with corresponding
trap, then the meta-handler would just implement that trap instead. This
would work.

Any other solution that uses 2 methods (e.g. [[Has]]+[[Invoke]],
[[Get]]+[[Invoke]], [[Get]]+[[InvokeFunction]]) will require the
meta-handler to implement 2 traps. Again, this is not fatal, but it does
make the pattern uglier.

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

More information about the es-discuss mailing list