poorlyfills
Simplified, partial, and poor ES6 collections polyfills, targeting IE9+ and older mobile browsers.
- Map based on double private arrays and
indexOf(...)
quirks - Set based on a map with same values as keys
- WeakMap based on a configurable, not enumerable, not writable, unique id property
- WeakSet based on a WeakMap and a simple
true
value per each key
All collections are missing constructor functionality and Symbols features.
How To
The index.js file is an ES2015 module you can include in your projects as such:
;
The native Map
, Set
, WeakMap
, and Weakset
will always be preferred over the fallback.
If you'd like to simply include this package on your Web pages, you can do it via unpkg:
Compatibility
You can test compatibility as both ES2015 module and ES5 transpiled code for IE9+.
... but why ...
After this tweet, and this request, and after writing myself these partial polyfills dunno how many times, I've decided to make it an official, fully test covered, package.