2012/11/14 Allen Wirfs-Brock <al...@wirfs-brock.com> > > On Nov 14, 2012, at 1:22 AM, Tom Van Cutsem wrote: > > Given approach 1) she can look at the full list of traps (e.g. the list at > the top of <http://wiki.ecmascript.org/doku.php?id=harmony:direct_proxies>) > and quickly figure out that she must implement the "has" trap. > > > But this might have effects far beyond just the in operator and it still > might not work. Unless it is explicitly specified (in an accessible place) > how does she know that "in" uses "has" instead of "hasOwn" or > "getOwnPropertyDescriptor" pus an explicit proto climb? Also what other > language features depend upon "has"? You can't just implement "has" for > the sole effect of intercept the "in"-operator. >
Agreed, the MOP methods serve multiple purposes, with many different operators potentially triggering the same MOP method. What I was getting at was that the derived traps enable more direct mappings for some operations that can be readily understood by ES5 programmers. Cheers, Tom
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss