Questions on Map and Set based on SpiderMonkey implementation
bruant.d at gmail.com
Sun Jan 22 09:52:46 PST 2012
SpiderMonkey implementation landed today. I was looking over the commit
 and had a question.
There is a test:
assertEq(Object.prototype.toString.call(new Map), "[object Map]");
I can't see anything about it neither in the latest spec draft nor in
the wiki proposal. Is it how Object.prototype.toString should behave. I
assume yes, but since there is no mention somewhere, it's probably worth
Likewise for Set.
Also, what is the benefit of Map.prototype being a map and Set.prototype
being a set? This is the kind of things that are true for all object
types and apparently, it has bitten (Date.prototype and
WeakMap.prototype offer a communication channel for potential attackers)
more than being helpful.
More information about the es-discuss