All Projects → polygonplanet → weakmap-polyfill

polygonplanet / weakmap-polyfill

Licence: MIT license
ECMAScript6 WeakMap polyfill

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to weakmap-polyfill

Core Js
Standard Library
Stars: ✭ 15,854 (+63316%)
Mutual labels:  polyfill, weakmap
Promise.allSettled
ES Proposal spec-compliant shim for Promise.allSettled
Stars: ✭ 93 (+272%)
Mutual labels:  polyfill
react-native-console-time-polyfill
console.time and console.timeEnd polyfill for react-native
Stars: ✭ 92 (+268%)
Mutual labels:  polyfill
ember-on-modifier
Implements the `{{on eventName this.someAction}}` element modifier from https://github.com/emberjs/rfcs/blob/master/text/0471-on-modifier.md
Stars: ✭ 37 (+48%)
Mutual labels:  polyfill
core2
The bare essentials of std::io for use in no_std. Alloc support is optional.
Stars: ✭ 67 (+168%)
Mutual labels:  polyfill
cardboard-vr-display
A JavaScript implementation of a WebVR 1.1 VRDisplay
Stars: ✭ 84 (+236%)
Mutual labels:  polyfill
PHPUnit-Polyfills
Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests
Stars: ✭ 147 (+488%)
Mutual labels:  polyfill
iframe-worker
A tiny WebWorker polyfill for the file:// protocol
Stars: ✭ 23 (-8%)
Mutual labels:  polyfill
Object.getOwnPropertyDescriptors
Spec-compliant shim for `Object.getOwnPropertyDescriptors` that works in ES5.
Stars: ✭ 19 (-24%)
Mutual labels:  polyfill
String.prototype.trim
ES5 spec-compliant shim for String.prototype.trim
Stars: ✭ 13 (-48%)
Mutual labels:  polyfill
sanitizer-polyfill
rewrite constructor arguments, call DOMPurify, profit
Stars: ✭ 46 (+84%)
Mutual labels:  polyfill
react-native-audio-polyfill
Audio polyfill for desktop and native.
Stars: ✭ 13 (-48%)
Mutual labels:  polyfill
react-native-drawer-layout-polyfill
A polyfill for React Natives DrawerLayoutAndroid
Stars: ✭ 48 (+92%)
Mutual labels:  polyfill
parsed-html-rewriter
A DOM-based implementation of Cloudflare Worker's HTMLRewriter.
Stars: ✭ 34 (+36%)
Mutual labels:  polyfill
parcel-plugin-goodie-bag
provides the Promise and fetch goodies needed for IE(11) support w/ parcel bundle loading
Stars: ✭ 15 (-40%)
Mutual labels:  polyfill
draggable-polyfill
🌈a beautify polyfill for native drag!
Stars: ✭ 49 (+96%)
Mutual labels:  polyfill
seamless-scroll-polyfill
Scroll Behavior polyfill
Stars: ✭ 134 (+436%)
Mutual labels:  polyfill
deno-fetch-event-adapter
Dispatches global fetch events using Deno's native http server.
Stars: ✭ 18 (-28%)
Mutual labels:  polyfill
polyfill-php81
This component provides functions unavailable in releases prior to PHP 8.1.
Stars: ✭ 618 (+2372%)
Mutual labels:  polyfill
fetch
A fetch API polyfill for React Native with text streaming support.
Stars: ✭ 27 (+8%)
Mutual labels:  polyfill

weakmap-polyfill

NPM Version Build Status Bundle Size (minified) GitHub License

ECMAScript6 WeakMap polyfill.

Installation

npm

$ npm install --save weakmap-polyfill

Usage

Import or require weakmap-polyfill, then WeakMap will be defined in the global scope if native WeakMap is not supported in running environment.

using import

import 'weakmap-polyfill';
const weakMap = new WeakMap();

using require

require('weakmap-polyfill');
var weakMap = new WeakMap();

browser (standalone)

<script src="weakmap-polyfill.min.js"></script>
<script>
var weakMap = new WeakMap();
</script>

Compatibility

  • Chrome 15
  • Firefox 3
  • IE 7
  • Safari 4
  • Opera 11.5
  • Edge

Browser Tests

Limitations

This polyfill has following few limitations.

  • WeakMap iterable argument is not supported. (23.3.1.1 WeakMap ( [ iterable ] ))
  • Frozen and sealed objects are not supported.
  • The values held by a WeakMap can't be collected once the map itself is GCed, since the values here are tied to the keys. #4

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].