[[Invoke]] and implicit method calls

Tom Van Cutsem tomvc.be at gmail.com
Thu Sep 19 05:25:09 PDT 2013


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

> 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?


You're right. The change would lead to observably different behavior for
conditionally invoked getters.

Not sure how much of a backwards compat issue that would be. Allen
previously wrote upstream in this thread:

There are currently 6 such places (not counting the Proxy trap invocators):
> 3 in ToPrimitive (ie toSrting/valueOf)
> 1 in instanceof to access @@hasInstance (legacy conpat. for missing
> @@hasInstance)
> 1 in [ ].toString to conditionally invoke 'join' method
> 1 in JSON.stringify conditionally invoke 'toJSON'


How likely is it that these are getters with side-effects?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130919/80ed6559/attachment-0001.html>


More information about the es-discuss mailing list