diff options
Diffstat (limited to 'tools/eslint/node_modules/es6-map')
15 files changed, 383 insertions, 13 deletions
diff --git a/tools/eslint/node_modules/es6-map/.npmignore b/tools/eslint/node_modules/es6-map/.npmignore new file mode 100644 index 0000000000..155e41f691 --- /dev/null +++ b/tools/eslint/node_modules/es6-map/.npmignore @@ -0,0 +1,4 @@ +.DS_Store +/node_modules +/npm-debug.log +/.lintcache diff --git a/tools/eslint/node_modules/es6-map/.travis.yml b/tools/eslint/node_modules/es6-map/.travis.yml new file mode 100644 index 0000000000..83625d8c3e --- /dev/null +++ b/tools/eslint/node_modules/es6-map/.travis.yml @@ -0,0 +1,12 @@ +sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/ +language: node_js +node_js: + - 0.12 + - 4 + - 5 + +notifications: + email: + - medikoo+es6-map@medikoo.com + +script: "npm test && npm run lint" diff --git a/tools/eslint/node_modules/es6-map/CHANGES b/tools/eslint/node_modules/es6-map/CHANGES new file mode 100644 index 0000000000..97f484a5c0 --- /dev/null +++ b/tools/eslint/node_modules/es6-map/CHANGES @@ -0,0 +1,26 @@ +v0.1.3 -- 2015.11.18 +* Relax validation of native implementation (do not require proper stringification of Map.prototype) + +v0.1.2 -- 2015.10.15 +* Improve native detection +* Ensure proper inheritance +* Update up to specification +* Fix spelling of LICENSE +* Update dependencies + +v0.1.1 -- 2014.10.07 +* Fix isImplemented so native Maps are detected properly +* Configure lint scripts + +v0.1.0 -- 2014.04.29 +* Assure strictly npm hosted dependencies +* Update to use latest versions of dependencies + +v0.0.1 -- 2014.04.25 +* Provide @@toStringTag symbol, and use other ES 6 symbols +* Fix iterators handling +* Fix isImplemented so it doesn't crash +* Update up to changes in dependencies + +v0.0.0 -- 2013.11.10 +- Initial (dev) version diff --git a/tools/eslint/node_modules/es6-map/package.json b/tools/eslint/node_modules/es6-map/package.json index 8d385618f2..1f1ff679fe 100644 --- a/tools/eslint/node_modules/es6-map/package.json +++ b/tools/eslint/node_modules/es6-map/package.json @@ -1,11 +1,11 @@ { "_args": [ [ - "es6-map@^0.1.2", - "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/escope" + "es6-map@^0.1.3", + "/Users/trott/test/node_modules/eslint" ] ], - "_from": "es6-map@>=0.1.2 <0.2.0", + "_from": "es6-map@>=0.1.3 <0.2.0", "_id": "es6-map@0.1.3", "_inCache": true, "_installable": true, @@ -19,20 +19,21 @@ "_phantomChildren": {}, "_requested": { "name": "es6-map", - "raw": "es6-map@^0.1.2", - "rawSpec": "^0.1.2", + "raw": "es6-map@^0.1.3", + "rawSpec": "^0.1.3", "scope": null, - "spec": ">=0.1.2 <0.2.0", + "spec": ">=0.1.3 <0.2.0", "type": "range" }, "_requiredBy": [ + "/eslint", "/eslint/escope" ], "_resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.3.tgz", "_shasum": "fe58c6654c6acd54e4397cdb72379d59b6ad5894", "_shrinkwrap": null, - "_spec": "es6-map@^0.1.2", - "_where": "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/escope", + "_spec": "es6-map@^0.1.3", + "_where": "/Users/trott/test/node_modules/eslint", "author": { "email": "medyk@medikoo.com", "name": "Mariusz Nowak", @@ -64,21 +65,21 @@ "homepage": "https://github.com/medikoo/es6-map#readme", "keywords": [ "collection", - "ecmascript", "es6", + "shim", "harmony", - "hash", "list", + "hash", "map", "polyfill", "ponyfill", - "shim" + "ecmascript" ], "license": "MIT", "maintainers": [ { - "name": "medikoo", - "email": "medikoo+npm@medikoo.com" + "email": "medikoo+npm@medikoo.com", + "name": "medikoo" } ], "name": "es6-map", diff --git a/tools/eslint/node_modules/es6-map/test/implement.js b/tools/eslint/node_modules/es6-map/test/implement.js new file mode 100644 index 0000000000..3569df61d2 --- /dev/null +++ b/tools/eslint/node_modules/es6-map/test/implement.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof Map, 'function'); }; diff --git a/tools/eslint/node_modules/es6-map/test/index.js b/tools/eslint/node_modules/es6-map/test/index.js new file mode 100644 index 0000000000..907b8c5a7b --- /dev/null +++ b/tools/eslint/node_modules/es6-map/test/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (T, a) { + a((new T([['raz', 1], ['dwa', 2]])).size, 2); +}; diff --git a/tools/eslint/node_modules/es6-map/test/is-implemented.js b/tools/eslint/node_modules/es6-map/test/is-implemented.js new file mode 100644 index 0000000000..06df91cc52 --- /dev/null +++ b/tools/eslint/node_modules/es6-map/test/is-implemented.js @@ -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.Map; + global.Map = polyfill; + a(t(), true); + if (cache === undefined) delete global.Map; + else global.Map = cache; +}; diff --git a/tools/eslint/node_modules/es6-map/test/is-map.js b/tools/eslint/node_modules/es6-map/test/is-map.js new file mode 100644 index 0000000000..f600b2298b --- /dev/null +++ b/tools/eslint/node_modules/es6-map/test/is-map.js @@ -0,0 +1,16 @@ +'use strict'; + +var MapPoly = 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 Map !== 'undefined') { + a(t(new Map()), true, "Native"); + } + a(t(new MapPoly()), true, "Polyfill"); +}; diff --git a/tools/eslint/node_modules/es6-map/test/is-native-implemented.js b/tools/eslint/node_modules/es6-map/test/is-native-implemented.js new file mode 100644 index 0000000000..df8ba0323f --- /dev/null +++ b/tools/eslint/node_modules/es6-map/test/is-native-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t, 'boolean'); }; diff --git a/tools/eslint/node_modules/es6-map/test/lib/iterator-kinds.js b/tools/eslint/node_modules/es6-map/test/lib/iterator-kinds.js new file mode 100644 index 0000000000..41ea10c57d --- /dev/null +++ b/tools/eslint/node_modules/es6-map/test/lib/iterator-kinds.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (t, a) { + a.deep(t, { key: true, value: true, 'key+value': true }); +}; diff --git a/tools/eslint/node_modules/es6-map/test/lib/iterator.js b/tools/eslint/node_modules/es6-map/test/lib/iterator.js new file mode 100644 index 0000000000..2688ed26cb --- /dev/null +++ b/tools/eslint/node_modules/es6-map/test/lib/iterator.js @@ -0,0 +1,13 @@ +'use strict'; + +var Map = require('../../polyfill') + , toArray = require('es5-ext/array/to-array'); + +module.exports = function (T, a) { + var arr = [['raz', 'one'], ['dwa', 'two']], map = new Map(arr); + + a.deep(toArray(new T(map)), arr, "Default"); + a.deep(toArray(new T(map, 'key+value')), arr, "Key & Value"); + a.deep(toArray(new T(map, 'value')), ['one', 'two'], "Value"); + a.deep(toArray(new T(map, 'key')), ['raz', 'dwa'], "Value"); +}; diff --git a/tools/eslint/node_modules/es6-map/test/lib/primitive-iterator.js b/tools/eslint/node_modules/es6-map/test/lib/primitive-iterator.js new file mode 100644 index 0000000000..ed2790de9b --- /dev/null +++ b/tools/eslint/node_modules/es6-map/test/lib/primitive-iterator.js @@ -0,0 +1,130 @@ +'use strict'; + +var iteratorSymbol = require('es6-symbol').iterator + , toArray = require('es5-ext/array/to-array') + , Map = require('../../primitive') + + , compare, mapToResults; + +compare = function (a, b) { + if (!a.value) return -1; + if (!b.value) return 1; + return a.value[0].localeCompare(b.value[0]); +}; + +mapToResults = function (arr) { + return arr.sort().map(function (value) { + return { done: false, value: value }; + }); +}; + +module.exports = function (T) { + return { + "": function (a) { + var arr, it, y, z, map, result = []; + + arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'], + ['cztery', 'four'], ['pięć', 'five']]; + map = new Map(arr); + + it = new T(map); + a(it[iteratorSymbol](), it, "@@iterator"); + y = it.next(); + result.push(y); + z = it.next(); + a.not(y, z, "Recreate result"); + result.push(z); + result.push(it.next()); + result.push(it.next()); + result.push(it.next()); + a.deep(result.sort(compare), mapToResults(arr)); + a.deep(y = it.next(), { done: true, value: undefined }, "End"); + a.not(y, it.next(), "Recreate result on dead"); + }, + Emited: function (a) { + var arr, it, map, result = []; + + arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'], + ['cztery', 'four'], ['pięć', 'five']]; + map = new Map(arr); + + it = new T(map); + result.push(it.next()); + result.push(it.next()); + map.set('sześć', 'six'); + arr.push(['sześć', 'six']); + result.push(it.next()); + map.delete('pięć'); + arr.splice(4, 1); + result.push(it.next()); + result.push(it.next()); + a.deep(result.sort(compare), mapToResults(arr)); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Emited #2": function (a) { + var arr, it, map, result = []; + + arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'], + ['cztery', 'four'], ['pięć', 'five'], ['sześć', 'six']]; + map = new Map(arr); + + it = new T(map); + result.push(it.next()); + result.push(it.next()); + map.set('siedem', 'seven'); + map.delete('siedem'); + result.push(it.next()); + result.push(it.next()); + map.delete('pięć'); + arr.splice(4, 1); + result.push(it.next()); + a.deep(result.sort(compare), mapToResults(arr)); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Emited: Clear #1": function (a) { + var arr, it, map, result = []; + + arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'], + ['cztery', 'four'], ['pięć', 'five'], ['sześć', 'six']]; + map = new Map(arr); + + it = new T(map); + result.push(it.next()); + result.push(it.next()); + arr = [['raz', 'one'], ['dwa', 'two']]; + map.clear(); + a.deep(result.sort(compare), mapToResults(arr)); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Emited: Clear #2": function (a) { + var arr, it, map, result = []; + + arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'], + ['cztery', 'four'], ['pięć', 'five'], ['sześć', 'six']]; + map = new Map(arr); + + it = new T(map); + result.push(it.next()); + result.push(it.next()); + map.clear(); + map.set('foo', 'bru'); + map.set('bar', 'far'); + arr = [['raz', 'one'], ['dwa', 'two'], ['foo', 'bru'], ['bar', 'far']]; + result.push(it.next()); + result.push(it.next()); + a.deep(result.sort(compare), mapToResults(arr)); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + Kinds: function (a) { + var arr = [['raz', 'one'], ['dwa', 'two']], map = new Map(arr); + + a.deep(toArray(new T(map)).sort(), arr.sort(), "Default"); + a.deep(toArray(new T(map, 'key+value')).sort(), arr.sort(), + "Key + Value"); + a.deep(toArray(new T(map, 'value')).sort(), ['one', 'two'].sort(), + "Value"); + a.deep(toArray(new T(map, 'key')).sort(), ['raz', 'dwa'].sort(), + "Key"); + } + }; +}; diff --git a/tools/eslint/node_modules/es6-map/test/polyfill.js b/tools/eslint/node_modules/es6-map/test/polyfill.js new file mode 100644 index 0000000000..6816cb049b --- /dev/null +++ b/tools/eslint/node_modules/es6-map/test/polyfill.js @@ -0,0 +1,60 @@ +'use strict'; + +var aFrom = require('es5-ext/array/from') + , toArray = require('es5-ext/array/to-array'); + +module.exports = function (T, a) { + var arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']] + , map = new T(arr), x = {}, y = {}, i = 0; + + a(map instanceof T, true, "Map"); + a(map.size, 3, "Size"); + a(map.get('raz'), 'one', "Get: contained"); + a(map.get(x), undefined, "Get: not contained"); + a(map.has('raz'), true, "Has: contained"); + a(map.has(x), false, "Has: not contained"); + a(map.set(x, y), map, "Set: return"); + a(map.has(x), true, "Set: has"); + a(map.get(x), y, "Set: get"); + a(map.size, 4, "Set: Size"); + map.set('dwa', x); + a(map.get('dwa'), x, "Overwrite: get"); + a(map.size, 4, "Overwrite: size"); + + a(map.delete({}), false, "Delete: false"); + + arr.push([x, y]); + arr[1][1] = x; + map.forEach(function () { + a.deep(aFrom(arguments), [arr[i][1], arr[i][0], map], + "ForEach: Arguments: #" + i); + a(this, y, "ForEach: Context: #" + i); + if (i === 0) { + a(map.delete('raz'), true, "Delete: true"); + a(map.has('raz'), false, "Delete"); + a(map.size, 3, "Delete: size"); + map.set('cztery', 'four'); + arr.push(['cztery', 'four']); + } + i++; + }, y); + arr.splice(0, 1); + + a.deep(toArray(map.entries()), [['dwa', x], ['trzy', 'three'], [x, y], + ['cztery', 'four']], "Entries"); + a.deep(toArray(map.keys()), ['dwa', 'trzy', x, 'cztery'], "Keys"); + a.deep(toArray(map.values()), [x, 'three', y, 'four'], "Values"); + a.deep(toArray(map), [['dwa', x], ['trzy', 'three'], [x, y], + ['cztery', 'four']], "Iterator"); + + map.clear(); + a(map.size, 0, "Clear: size"); + a(map.has('trzy'), false, "Clear: has"); + a.deep(toArray(map), [], "Clear: Values"); + + a.h1("Empty initialization"); + map = new T(); + map.set('foo', 'bar'); + a(map.size, 1); + a(map.get('foo'), 'bar'); +}; diff --git a/tools/eslint/node_modules/es6-map/test/primitive/index.js b/tools/eslint/node_modules/es6-map/test/primitive/index.js new file mode 100644 index 0000000000..a99c68522d --- /dev/null +++ b/tools/eslint/node_modules/es6-map/test/primitive/index.js @@ -0,0 +1,59 @@ +'use strict'; + +var aFrom = require('es5-ext/array/from') + , getIterator = require('es6-iterator/get') + , toArray = require('es5-ext/array/to-array'); + +module.exports = function (T, a) { + var arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']] + , map = new T(arr), x = 'other', y = 'other2' + , i = 0, result = []; + + a(map instanceof T, true, "Map"); + a(map.size, 3, "Size"); + a(map.get('raz'), 'one', "Get: contained"); + a(map.get(x), undefined, "Get: not contained"); + a(map.has('raz'), true, "Has: true"); + a(map.has(x), false, "Has: false"); + a(map.set(x, y), map, "Add: return"); + a(map.has(x), true, "Add"); + a(map.size, 4, "Add: Size"); + map.set('dwa', x); + a(map.get('dwa'), x, "Overwrite: get"); + a(map.size, 4, "Overwrite: size"); + + a(map.delete('else'), false, "Delete: false"); + + arr.push([x, y]); + arr[1][1] = x; + map.forEach(function () { + result.push(aFrom(arguments)); + a(this, y, "ForEach: Context: #" + i); + }, y); + + a.deep(result.sort(function (a, b) { + return String([a[1], a[0]]).localeCompare([b[1], b[0]]); + }), arr.sort().map(function (val) { return [val[1], val[0], map]; }), + "ForEach: Arguments"); + + a.deep(toArray(map.entries()).sort(), [['dwa', x], ['trzy', 'three'], + [x, y], ['raz', 'one']].sort(), "Entries"); + a.deep(toArray(map.keys()).sort(), ['dwa', 'trzy', x, 'raz'].sort(), + "Keys"); + a.deep(toArray(map.values()).sort(), [x, 'three', y, 'one'].sort(), + "Values"); + a.deep(toArray(getIterator(map)).sort(), [['dwa', x], ['trzy', 'three'], + [x, y], ['raz', 'one']].sort(), + "Iterator"); + + map.clear(); + a(map.size, 0, "Clear: size"); + a(map.has('trzy'), false, "Clear: has"); + a.deep(toArray(map.values()), [], "Clear: Values"); + + a.h1("Empty initialization"); + map = new T(); + map.set('foo', 'bar'); + a(map.size, 1); + a(map.get('foo'), 'bar'); +}; diff --git a/tools/eslint/node_modules/es6-map/test/valid-map.js b/tools/eslint/node_modules/es6-map/test/valid-map.js new file mode 100644 index 0000000000..ac0314949a --- /dev/null +++ b/tools/eslint/node_modules/es6-map/test/valid-map.js @@ -0,0 +1,19 @@ +'use strict'; + +var MapPoly = 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 Map !== 'undefined') { + map = new Map(); + a(t(map), map, "Native"); + } + map = new MapPoly(); + a(t(map), map, "Polyfill"); +}; |