forked from enviPath/enviPy
Current Dev State
This commit is contained in:
3
static/js/ketcher2/node_modules/es6-weak-map/test/implement.js
generated
vendored
Normal file
3
static/js/ketcher2/node_modules/es6-weak-map/test/implement.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (t, a) { a(typeof WeakMap, 'function'); };
|
||||
6
static/js/ketcher2/node_modules/es6-weak-map/test/index.js
generated
vendored
Normal file
6
static/js/ketcher2/node_modules/es6-weak-map/test/index.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (T, a) {
|
||||
var x = {};
|
||||
a((new T([[x, 'foo']])).get(x), 'foo');
|
||||
};
|
||||
14
static/js/ketcher2/node_modules/es6-weak-map/test/is-implemented.js
generated
vendored
Normal file
14
static/js/ketcher2/node_modules/es6-weak-map/test/is-implemented.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
var global = require('es5-ext/global')
|
||||
, polyfill = require('../polyfill');
|
||||
|
||||
module.exports = function (t, a) {
|
||||
var cache;
|
||||
a(typeof t(), 'boolean');
|
||||
cache = global.WeakMap;
|
||||
global.WeakMap = polyfill;
|
||||
a(t(), true);
|
||||
if (cache === undefined) delete global.WeakMap;
|
||||
else global.WeakMap = cache;
|
||||
};
|
||||
3
static/js/ketcher2/node_modules/es6-weak-map/test/is-native-implemented.js
generated
vendored
Normal file
3
static/js/ketcher2/node_modules/es6-weak-map/test/is-native-implemented.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (t, a) { a(typeof t, 'boolean'); };
|
||||
16
static/js/ketcher2/node_modules/es6-weak-map/test/is-weak-map.js
generated
vendored
Normal file
16
static/js/ketcher2/node_modules/es6-weak-map/test/is-weak-map.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
var WeakMapPoly = require('../polyfill');
|
||||
|
||||
module.exports = function (t, a) {
|
||||
a(t(undefined), false, "Undefined");
|
||||
a(t(null), false, "Null");
|
||||
a(t(true), false, "Primitive");
|
||||
a(t('raz'), false, "String");
|
||||
a(t({}), false, "Object");
|
||||
a(t([]), false, "Array");
|
||||
if (typeof WeakMap !== 'undefined') {
|
||||
a(t(new WeakMap()), true, "Native");
|
||||
}
|
||||
a(t(new WeakMapPoly()), true, "Polyfill");
|
||||
};
|
||||
23
static/js/ketcher2/node_modules/es6-weak-map/test/polyfill.js
generated
vendored
Normal file
23
static/js/ketcher2/node_modules/es6-weak-map/test/polyfill.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
'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');
|
||||
};
|
||||
19
static/js/ketcher2/node_modules/es6-weak-map/test/valid-weak-map.js
generated
vendored
Normal file
19
static/js/ketcher2/node_modules/es6-weak-map/test/valid-weak-map.js
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
var WeakMapPoly = require('../polyfill');
|
||||
|
||||
module.exports = function (t, a) {
|
||||
var map;
|
||||
a.throws(function () { t(undefined); }, TypeError, "Undefined");
|
||||
a.throws(function () { t(null); }, TypeError, "Null");
|
||||
a.throws(function () { t(true); }, TypeError, "Primitive");
|
||||
a.throws(function () { t('raz'); }, TypeError, "String");
|
||||
a.throws(function () { t({}); }, TypeError, "Object");
|
||||
a.throws(function () { t([]); }, TypeError, "Array");
|
||||
if (typeof WeakMap !== 'undefined') {
|
||||
map = new WeakMap();
|
||||
a(t(map), map, "Native");
|
||||
}
|
||||
map = new WeakMapPoly();
|
||||
a(t(map), map, "Polyfill");
|
||||
};
|
||||
Reference in New Issue
Block a user