Sha256: d90bb11e3618c278864ae86f8b86880b187c8113d71c796104de2e31db7f35b1

Contents?: true

Size: 677 Bytes

Versions: 23

Compression:

Stored size: 677 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.h1("Empty initialization");
	map = new T();
	map.set(x, 'bar');
	a(map.get(x), 'bar');
};

Version data entries

23 entries across 23 versions & 6 rubygems

Version Path
govuk_publishing_components-16.29.0 node_modules/es6-weak-map/test/polyfill.js
govuk_publishing_components-16.28.0 node_modules/es6-weak-map/test/polyfill.js
govuk_publishing_components-16.27.1 node_modules/es6-weak-map/test/polyfill.js
govuk_publishing_components-16.27.0 node_modules/es6-weak-map/test/polyfill.js
govuk_publishing_components-16.26.0 node_modules/es6-weak-map/test/polyfill.js
govuk_publishing_components-16.25.0 node_modules/es6-weak-map/test/polyfill.js
govuk_publishing_components-16.24.0 node_modules/es6-weak-map/test/polyfill.js
govuk_publishing_components-16.23.0 node_modules/es6-weak-map/test/polyfill.js
govuk_publishing_components-16.22.0 node_modules/es6-weak-map/test/polyfill.js
govuk_publishing_components-16.21.0 node_modules/es6-weak-map/test/polyfill.js
govuk_publishing_components-16.20.1 node_modules/es6-weak-map/test/polyfill.js
govuk_publishing_components-16.20.0 node_modules/es6-weak-map/test/polyfill.js
govuk_publishing_components-16.19.0 node_modules/es6-weak-map/test/polyfill.js
govuk_publishing_components-16.18.0 node_modules/es6-weak-map/test/polyfill.js
govuk_publishing_components-16.17.0 node_modules/es6-weak-map/test/polyfill.js
optimacms-0.4.3 spec/dummy/node_modules/es6-weak-map/test/polyfill.js
optimacms-0.4.2 spec/dummy/node_modules/es6-weak-map/test/polyfill.js
cortex-0.1.3 spec/dummy/node_modules/es6-weak-map/test/polyfill.js
guard-sass-lint-0.1.2 node_modules/es6-weak-map/test/polyfill.js
guard-sass-lint-0.1.1 node_modules/es6-weak-map/test/polyfill.js