Adding [[Invoke]] to address issues with methods called on Proxies

Herby Vojčík herby at mailbox.sk
Tue Jan 29 11:39:10 PST 2013


> [snip]
>
> It is basically the idea that OOP call is three-part:
> [[Get]] (trappable)
> [[ChooseThis]] (by default choosing the base of Ref; trappable)
> [[Call]] (in this context (receiver being proxy) untrappable; if a
> function itself is proxy, it's already someone else's problem)
>
> .apply and .call would do the last two.

I now see that things are more complicated and that it is not as simple 
as it looked. Proxies want to choose what this to use not based on 
function itself, but based on property, I presume, so [[ChooseThis]] 
would need property. But it then doesn't help the

   var quux = foo.bar;
   quux.call(foo, baz);

case, since quux.call have no information that the property was 'bar' 
:-( Pity.

This slightly lowers usability of this solution (one can use 
[[MethodName]] as a property is .call and .apply, but ... that's not 
nice). I think it is still better than [[CallProperty]] that races with 
[[Get]] and is specific for proxies and method invocation case, but.

Or is so that certain kind of proxies would always use own identity and 
another kind always target identity, not based on which property am I 
calling? In that case, this solution is fine.

> Herby


More information about the es-discuss mailing list