On Fri, May 24, 2013 at 2:35 PM, Ron Buckton <[email protected]> wrote: > Another way to look at this is that there is no way to prevent a caller from > using methods from the superclass on a subclass. In other OO languages, its > much harder (or nearly impossible depending on the language) to forcibly call > a superclass method against a subclass that has been overridden by the > subclass. > > Tab wouldn't have this issue if there were a way to prevent an external > caller from executing Map.prototype.set.call(mapSubclass) if the mapSubclass > overrides `set`.
Sure, but that's attacking it on the wrong level, I think. The problem is that the Map#set method grabs an *internal property*, bypassing Proxies, etc., so you can't defend against it. If I could intercept access to [[MapData]] via proxy traps (like David suggests in the OP), everything would be *perfect* - every single problem I have would be resolved successfully, as would every additional possibility that Jason brings up. If Maps used a Map.MapDataSymbol, I could intercept it via proxies by adding it to the symbol whitelist and do what I needed. Of course, the object represented by [[MapData]] is too abstract to *actually* do that, but we could expose some interactions for it. ~TJ _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

