[[Invoke]] and implicit method calls

Till Schneidereit till at tillschneidereit.net
Tue Sep 10 08:20:07 PDT 2013

On Tue, Sep 10, 2013 at 5:03 PM, Allen Wirfs-Brock <allen at wirfs-brock.com>wrote:

> On Sep 10, 2013, at 3:55 AM, Till Schneidereit wrote:
> When implementing the [[Invoke]] trap in SpiderMonkey, I went with the
> assumption that it should apply to all calls of the forms `receiver.fun()`
> and `receiver["fun"]()`. Jason pointed out that `with (receiver) { fun() }`
> should be caught, too. Doing anything else would make for a surprising
> restriction of proxies' capabilities compared to manually overriding
> methods, IMO.
> Yes, that's already covered in the spec. See
> http://people.mozilla.org/~jorendorff/es6-draft.html#sec-12.2.3 Step 1.b
> of EvaluateCall

I didn't mean to put the focus on `with`, sorry. I meant that trapping
[[Invoke]] shouldn't leave any calls untrapped that the user can "trap"
manually by overriding methods. For that to work, a version of [[Invoke]]
seems to be required that doesn't throw if the method doesn't exist on the
receiver, though.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130910/6dbb3005/attachment.html>

More information about the es-discuss mailing list