On Nov 1, 2013, at 7:27 PM, Brandon Benvie wrote: > On 11/1/2013 7:13 PM, Allen Wirfs-Brock wrote: >> Or we could simply not special case Proxy exotic objects and then Proxies >> would be handled like any other object, the value of the objects >> @@toStringTag property would be accessed and used to compose the toString >> result. > > Which would result in things like "[object ~Array]". That'd probably be > preferable than always returning "[object Proxy]" because at least you have > the option of special casing it if you desire. I don't know though, because a > Proxy for a Map would return "[object Map]", making it indistinguishable from > a map yet it's still just as useless as a Proxy for a Date.
Remember, O.p.toString is not a reliable brand test for anything other than built-ins that existed prior to ES6. You should be trying to brand something defined via a proxy or any new built-in like Map. > > This just reminds me how cold I still am on the fact that you can't easily > one-off Proxy anything that's not a plain Object, Array, or Function because > of the lack of an invoke trap and every other type of built-in has private > state... but I suppose this isn't really the thread for that. Right. Deciding what we want for O.p.toString is a much simpler problem. Allen > _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss