[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
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to