Harmony-Enumerables for Node.js
What is this?
A small polyfill for ES6 collections that leverages non-enumerable Node.js Map/WeakMap where possible. It's designed to leverage the incomplete --harmony Map/Set/WeakMap implementation where possible, while adding iterators. In vanilla node, or Chrome, Map, Set, and WeakMap are polyfilled.
Unsuprisingly, the polyfill does some weird stuff. Specifically, it creates random, non-enumerable properties on your objects. If you don't like that, that's fine, just use one of the other, less imposing ES6 polyfills for Map, Set, and WeakMap.
For example:
var eSet = Set; var s = ;s;s;s; var x = 0;s assert; // true
In addition to forEach, it also adds an iterator interface:
var eMap = Map;var m = ;m;m;m; var x = 0;var iter = m;while !iterdone var keyValue = iternext; var key = keyValue0; var value = keyValue1; x += value; assert; // true
if you call .polyfill(), it will overwrite the global definitions.
;