Skip to content

ungap/weakmap

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
cjs
 
 
esm
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

WeakMap

Build Status Coverage Status Greenkeeper badge WebReflection status

An essential WeakMap polyfill for legacy browsers (IE < 11).

Compatible down to IE9, works well with ES5 shim upfront in IE8 (and maybe lower too).

Live test

Transpiled code and frozen objects in legacy browsers

If you need this module to work in IE < 11 too with frozen objects, or template literals frozen via Babel transpilation, you need to either nullify Object.freeze and others via something like <script>this.WeakMap||(Object.freeze=Object);</script> on top of your pages, or you can nullify only template literals through:

<script>
this.WeakMap||(function(O,f){
  f=O.freeze||O;O.freeze=function(o){return'raw'in o?o:f(o)}
}(Object));
</script>

About

An essential WeakMap polyfill for legacy browsers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published