EmptyWeakMap

A WeakMap implementation that immediately frees its elements.

Values passed to set are never stored, so the map is always empty.

Use this implementation when testing algorithms that use a weak map, to ensure they don't rely on the value still existing.

See also

Opposite behavior: values are never freed.