There's multiple polyfills for Map, Set, and WeakMap (WeakMap not being fully implementable, but close). Here's one: http://benvie.github.com/harmony-collections.
On Thu, Jan 17, 2013 at 1:55 PM, Thaddee Tyl <[email protected]> wrote: > I believe it is impossible to do even a partially functional polyfill > for Maps and Sets in ES5. > Indeed, the only way to iterate through it is with the 'for (… of …)' > construct, which is sure to break in ES5. > > I wish there was a way to polyfill it. > Something like 'Map.prototype.getKeys' could return an array of key > entries, for instance. > Obviously, Sets would benefit from the same treatment. > > In the case of Sets especially, I can see this method as being > something that everybody would end up writing many times manually, > similar to how they now write the boilerplate to treat 'arguments' > like an Array, over and over again. > > Could we consider something like that, please? > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

