On Sat, May 1, 2010 at 1:27 PM, Brendan Eich <[email protected]> wrote: > 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__
I don't. I want proxies instead. ;) > -- 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. I just saw Oliver's response. If some major JS implementations cannot provide this additional flag without slowing down normal non-proxy access, then I'd agree we need to drop it. Support for proxies must impose no overhead on access to non-proxies. But if this flag can be provided without additional overhead on non-proxies, I do think it is desirable. It solves a number of problems... > > /be > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > -- Cheers, --MarkM _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

