]>
git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/ex-mode/node_modules/space-pen/node_modules/grim/node_modules/emissary/node_modules/es6-weak-map/test/polyfill.js
1a4885be8354e026ef79474cf0e1ca6227a967ca
3 module
.exports = function (T
, a
) {
4 var x
= {}, y
= {}, z
= {}, arr
= [[x
, 'raz'], [y
, 'dwa']], map
= new T(arr
);
6 a(map
instanceof T
, true, "WeakMap");
7 a(map
.has(x
), true, "Has: true");
8 a(map
.get(x
), 'raz', "Get: contains");
9 a(map
.has(z
), false, "Has: false");
10 a(map
.get(z
), undefined, "Get: doesn't contain");
11 a(map
.set(z
, 'trzy'), map
, "Set: return");
12 a(map
.has(z
), true, "Add");
13 a(map
.delete({}), false, "Delete: false");
15 a(map
.delete(x
), true, "Delete: true");
16 a(map
.get(x
), undefined, "Get: after delete");
17 a(map
.has(x
), false, "Has: after delete");
19 a(map
.has(y
), true, "Has: pre clear");
21 a(map
.has(y
), false, "Has: after clear");