Sha256: 095a274c49390798b840ab10ada1327af52b73a54bda74acfe29c23b64338411

Contents?: true

Size: 684 Bytes

Versions: 16

Compression:

Stored size: 684 Bytes

Contents

'use strict';

module.exports = function (T, a) {
	var x = {}, y = {}, z = {}, arr = [[x, 'raz'], [y, 'dwa']], map = new T(arr);

	a(map instanceof T, true, "WeakMap");
	a(map.has(x), true, "Has: true");
	a(map.get(x), 'raz', "Get: contains");
	a(map.has(z), false, "Has: false");
	a(map.get(z), undefined, "Get: doesn't contain");
	a(map.set(z, 'trzy'), map, "Set: return");
	a(map.has(z), true, "Add");
	a(map.delete({}), false, "Delete: false");

	a(map.delete(x), true, "Delete: true");
	a(map.get(x), undefined, "Get: after delete");
	a(map.has(x), false, "Has: after delete");

	a(map.has(y), true, "Has: pre clear");
	map.clear();
	a(map.has(y), false, "Has: after clear");
};

Version data entries

16 entries across 9 versions & 2 rubygems

Version Path
eslint_node_modules-1.6.0.1 vendor/node_modules/eslint/node_modules/escope/node_modules/es6-weak-map/test/polyfill.js
eslint_node_modules-1.6.0 vendor/node_modules/eslint/node_modules/escope/node_modules/es6-weak-map/test/polyfill.js
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/test/polyfill.js
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/test/polyfill.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/test/polyfill.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/test/polyfill.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/test/polyfill.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/test/polyfill.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/test/polyfill.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/test/polyfill.js
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/test/polyfill.js
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/test/polyfill.js
entangled-0.0.11 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/test/polyfill.js
entangled-0.0.11 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/test/polyfill.js
entangled-0.0.10 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/test/polyfill.js
entangled-0.0.10 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/test/polyfill.js