[[Invoke]] and implicit method calls

Allen Wirfs-Brock allen at wirfs-brock.com
Thu Sep 19 05:32:48 PDT 2013

On Sep 19, 2013, at 8:05 AM, Brendan Eich wrote:

>> Tom Van Cutsem <mailto:tomvc.be at gmail.com>
>> September 19, 2013 9:53 AM
>> 2013/9/19 Allen Wirfs-Brock <allen at wirfs-brock.com <mailto:allen at wirfs-brock.com>>
>>    I really don't think we need to debate this much longer.  We just
>>    need to stay the course with [[Invoke]] and I can update the spec.
>>    to replace [[Get]]+[[Invoke]] rather than [[Get]]+[[Call]] for
>>    this conditional situations. I may also added add a note
>>    suggesting that the extra [[Get]] can be eliminated.
>> Refactoring [[Get]]+[[Call]] to [[Get]]+[[Invoke]] seems fine by me. It better expresses the intent, and the change should only be observable to proxies.
> Is this so? Wouldn't an ordinary object with a getter be able to observe the two lookups? Indeed wouldn't the spec require this?

Yes, the two lookups are observable via a getter.  I mentioned that in a comment when I should how the ToPrimitive 'valueOf' invocation might be optimized.  However, my argument was that [[Get]]+[[Invoke]] better reflects the abstract intent and that intent implicitly includes two lookup. I think this difference (from ES<=5.1) is unlikely to be significance for the few specific existing cases where this occurs in the spec.


More information about the es-discuss mailing list