Tech talk on proxies and traits
brendan at mozilla.com
Sat May 1 13:27:22 PDT 2010
On May 1, 2010, at 12:34 PM, Faisal Vali wrote:
> As I read the proposal, I do wish an invoke-like trap had been
> accepted - but I understand that there were some technicalities that
> proved unresolvable.
Everyone wants __noSuchMethod__ -- we still support it in
SpiderMonkey, and probably will for a long time.
> A simple solution that would allow maintaining the
> above mentioned 'invariant' in most cases and allow breaking it when
> necessary would involve a flag passed into the 'get' handler
> indicating that the property is about to be 'called'. What would be
> the negative ramifications of such a solution (asides from the fact
> that it may get abused - like the 'get' accessor in es5 ;)?
This is a good idea. In all practical implementations, callee
expressions are specialized so the "get" can tell it is computing a
callee. This is done to bind |this| in the call expression of which
the callee expression is a left prefix.
Mark and Tom may have thoughts.
More information about the es-discuss