[[Invoke]] and implicit method calls

Tom Van Cutsem tomvc.be at gmail.com
Thu Sep 19 06:49:56 PDT 2013


2013/9/19 Mark S. Miller <erights at google.com>

> Not sure I understand this. Would the same [[Get]] + [[Invoke]] behavior
> be caused by the following JS pattern:
>
>     if (base[index]) { return base[index](...args); }
>
> as opposed to the [[Get]] + [[Call]] behavior caused by the pattern
>
>     if ((f = base[index])) { f.call(base, ...args); }
>
> (aside from the difference between .call and .[[Call]]) ?
>
> Is it a problem that in the first pattern, the two invocations of
> base[index] might return different things?
>

Not necessarily a problem, but yes, that is the observable difference (or
the two accesses might return the same function, but meanwhile mutate some
other state).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130919/9b0158fe/attachment.html>


More information about the es-discuss mailing list