0.2.0 - Mid migration

This commit is contained in:
Daniel Mason 2022-04-25 14:47:15 +12:00
parent 139e6a915e
commit 7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../array/#/@@iterator/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

View file

@ -0,0 +1,9 @@
"use strict";
exports.__generic = function (t, a) {
var iterator = t.call(this);
a.deep(iterator.next(), { value: "1", done: false });
a.deep(iterator.next(), { value: "2", done: false });
a.deep(iterator.next(), { value: "3", done: false });
a.deep(iterator.next(), { value: undefined, done: true });
};

View file

@ -0,0 +1,7 @@
"use strict";
module.exports = function (t, a) {
var arr = [4, 5, 6], obj1 = { length: 8 }, obj2 = {}, obj3 = { length: 1 };
a.deep([arr, obj1, obj2, obj3].sort(t), [obj2, obj3, arr, obj1]);
};

15
web/node_modules/es5-ext/test/array/#/binary-search.js generated vendored Normal file
View file

@ -0,0 +1,15 @@
"use strict";
var compare = function (value) { return this - value; };
module.exports = function (t, a) {
var arr;
arr = [2, 5, 5, 8, 34, 67, 98, 345, 678];
// Highest, equal match
a(t.call(arr, compare.bind(1)), 0, "All higher");
a(t.call(arr, compare.bind(679)), arr.length - 1, "All lower");
a(t.call(arr, compare.bind(4)), 0, "Mid");
a(t.call(arr, compare.bind(5)), 2, "Match");
a(t.call(arr, compare.bind(6)), 2, "Above");
};

7
web/node_modules/es5-ext/test/array/#/clear.js generated vendored Normal file
View file

@ -0,0 +1,7 @@
"use strict";
module.exports = function (t, a) {
var arr = [1, 2, {}, 4];
a(t.call(arr), arr, "Returns same array");
a.deep(arr, [], "Empties array");
};

15
web/node_modules/es5-ext/test/array/#/compact.js generated vendored Normal file
View file

@ -0,0 +1,15 @@
"use strict";
module.exports = {
"__generic": function (t, a) { a(t.call(this).length, 3); },
"": function (t, a) {
var o, x, y, z;
o = {};
x = [0, 1, "", null, o, false, undefined, true];
y = x.slice(0);
a.not((z = t.call(x)), x, "Returns different object");
a.deep(x, y, "Origin not changed");
a.deep(z, [0, 1, "", o, false, true], "Result");
}
};

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../array/#/concat/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

29
web/node_modules/es5-ext/test/array/#/concat/shim.js generated vendored Normal file
View file

@ -0,0 +1,29 @@
"use strict";
var isConcatSpreadable = require("es6-symbol").isConcatSpreadable
, SubArray = require("../../../../array/_sub-array-dummy-safe");
module.exports = function (t, a) {
var arr = [1, 3, 45], x = {}, subArr, subArr2, result;
a.deep(
t.call(arr, "2d", x, ["ere", "fe", x], false, null),
[1, 3, 45, "2d", x, "ere", "fe", x, false, null], "Plain array"
);
subArr = new SubArray("lol", "miszko");
subArr2 = new SubArray("elo", "fol");
result = t.call(subArr, "df", arr, "fef", subArr2, null);
a(result instanceof SubArray, true, "Instance of subclass");
a.deep(
result, ["lol", "miszko", "df", 1, 3, 45, "fef", "elo", "fol", null], "Spreable by default"
);
SubArray.prototype[isConcatSpreadable] = false;
result = t.call(subArr, "df", arr, "fef", subArr2, null);
a.deep(result, [subArr, "df", 1, 3, 45, "fef", subArr2, null], "Non spreadable");
delete SubArray.prototype[isConcatSpreadable];
};

21
web/node_modules/es5-ext/test/array/#/contains.js generated vendored Normal file
View file

@ -0,0 +1,21 @@
"use strict";
module.exports = {
"__generic": function (t, a) {
a(t.call(this, this[1]), true, "Contains");
a(t.call(this, {}), false, "Does Not contain");
},
"": function (t, a) {
var o, x = {}, y = {};
o = [1, "raz", x];
a(t.call(o, 1), true, "First");
a(t.call(o, "1"), false, "Type coercion");
a(t.call(o, "raz"), true, "Primitive");
a(t.call(o, "foo"), false, "Primitive not found");
a(t.call(o, x), true, "Object found");
a(t.call(o, y), false, "Object not found");
a(t.call(o, 1, 1), false, "Position");
}
};

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../array/#/copy-within/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

View file

@ -0,0 +1,29 @@
"use strict";
module.exports = function (t, a) {
var args, x;
a.h1("2 args");
x = [1, 2, 3, 4, 5];
t.call(x, 0, 3);
a.deep(x, [4, 5, 3, 4, 5]);
a.deep(t.call([1, 2, 3, 4, 5], 1, 3), [1, 4, 5, 4, 5]);
a.deep(t.call([1, 2, 3, 4, 5], 1, 2), [1, 3, 4, 5, 5]);
a.deep(t.call([1, 2, 3, 4, 5], 2, 2), [1, 2, 3, 4, 5]);
a.h1("3 args");
a.deep(t.call([1, 2, 3, 4, 5], 0, 3, 4), [4, 2, 3, 4, 5]);
a.deep(t.call([1, 2, 3, 4, 5], 1, 3, 4), [1, 4, 3, 4, 5]);
a.deep(t.call([1, 2, 3, 4, 5], 1, 2, 4), [1, 3, 4, 4, 5]);
a.h1("Negative args");
a.deep(t.call([1, 2, 3, 4, 5], 0, -2), [4, 5, 3, 4, 5]);
a.deep(t.call([1, 2, 3, 4, 5], 0, -2, -1), [4, 2, 3, 4, 5]);
a.deep(t.call([1, 2, 3, 4, 5], -4, -3, -2), [1, 3, 3, 4, 5]);
a.deep(t.call([1, 2, 3, 4, 5], -4, -3, -1), [1, 3, 4, 4, 5]);
a.deep(t.call([1, 2, 3, 4, 5], -4, -3), [1, 3, 4, 5, 5]);
a.h1("Array-likes");
args = { 0: 1, 1: 2, 2: 3, length: 3 };
a.deep(t.call(args, -2, 0), { 0: 1, 1: 1, 2: 2, length: 3 });
};

13
web/node_modules/es5-ext/test/array/#/diff.js generated vendored Normal file
View file

@ -0,0 +1,13 @@
"use strict";
module.exports = {
"__generic": function (t, a) { a.deep(t.call(this, this), []); },
"": function (t, a) {
var x = {}, y = {};
a.deep(t.call([1, "raz", x, 2, "trzy", y], [x, 2, "trzy"]), [1, "raz", y], "Scope longer");
a.deep(t.call([1, "raz", x], [x, 2, "trzy", 1, y]), ["raz"], "Arg longer");
a.deep(t.call([1, "raz", x], []), [1, "raz", x], "Empty arg");
a.deep(t.call([], [1, y, "sdfs"]), [], "Empty scope");
}
};

13
web/node_modules/es5-ext/test/array/#/e-index-of.js generated vendored Normal file
View file

@ -0,0 +1,13 @@
"use strict";
module.exports = function (t, a) {
var x = {};
a(t.call([3, "raz", {}, x, {}], x), 3, "Regular");
a(t.call([3, "raz", NaN, {}, NaN], NaN), 2, "NaN");
a(t.call([3, "raz", 0, {}, -0], -0), 2, "-0");
a(t.call([3, "raz", -0, {}, 0], +0), 2, "+0");
a(t.call([3, "raz", NaN, {}, NaN], NaN, 3), 4, "fromIndex");
a(t.call([3, "raz", NaN, {}, NaN], NaN, -1), 4, "fromIndex negative #1");
a(t.call([3, "raz", NaN, {}, NaN], NaN, -2), 4, "fromIndex negative #2");
a(t.call([3, "raz", NaN, {}, NaN], NaN, -3), 2, "fromIndex negative #3");
};

View file

@ -0,0 +1,12 @@
"use strict";
module.exports = function (t, a) {
var x = {};
a(t.call([3, "raz", {}, x, {}, x], x), 5, "Regular");
a(t.call([3, "raz", NaN, {}, x], NaN), 2, "NaN");
a(t.call([3, "raz", 0, {}, -0], -0), 4, "-0");
a(t.call([3, "raz", -0, {}, 0], +0), 4, "+0");
a(t.call([3, "raz", NaN, {}, NaN], NaN, 3), 2, "fromIndex");
a(t.call([3, "raz", NaN, 2, NaN], NaN, -1), 4, "Negative fromIndex #1");
a(t.call([3, "raz", NaN, 2, NaN], NaN, -2), 2, "Negative fromIndex #2");
};

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../array/#/entries/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

View file

@ -0,0 +1,9 @@
"use strict";
exports.__generic = function (t, a) {
var iterator = t.call(this);
a.deep(iterator.next(), { value: [0, "1"], done: false });
a.deep(iterator.next(), { value: [1, "2"], done: false });
a.deep(iterator.next(), { value: [2, "3"], done: false });
a.deep(iterator.next(), { value: undefined, done: true });
};

15
web/node_modules/es5-ext/test/array/#/exclusion.js generated vendored Normal file
View file

@ -0,0 +1,15 @@
"use strict";
module.exports = {
"__generic": function (t, a) {
var x = {};
a.deep(t.call(this, this, [this[0], this[2], x]), [x]);
},
"": function (t, a) {
var x = {}, y = {};
a.deep(t.call([x, y]), [x, y], "No arguments");
a.deep(t.call([x, 1], [], []), [x, 1], "Empty arguments");
a.deep(t.call([1, "raz", x], [2, "raz", y], [2, "raz", x]), [1, y]);
}
};

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../array/#/fill/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

3
web/node_modules/es5-ext/test/array/#/fill/index.js generated vendored Normal file
View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

15
web/node_modules/es5-ext/test/array/#/fill/shim.js generated vendored Normal file
View file

@ -0,0 +1,15 @@
// Taken from https://github.com/paulmillr/es6-shim/blob/master/test/array.js
"use strict";
module.exports = function (t, a) {
var x;
x = [1, 2, 3, 4, 5, 6];
a(t.call(x, -1), x, "Returns self object");
a.deep(x, [-1, -1, -1, -1, -1, -1], "Value");
a.deep(t.call([1, 2, 3, 4, 5, 6], -1, 3), [1, 2, 3, -1, -1, -1], "Positive start");
a.deep(t.call([1, 2, 3, 4, 5, 6], -1, -3), [1, 2, 3, -1, -1, -1], "Negative start");
a.deep(t.call([1, 2, 3, 4, 5, 6], -1, 9), [1, 2, 3, 4, 5, 6], "Large start");
};

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../array/#/filter/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

17
web/node_modules/es5-ext/test/array/#/filter/shim.js generated vendored Normal file
View file

@ -0,0 +1,17 @@
"use strict";
var SubArray = require("../../../../array/_sub-array-dummy-safe");
module.exports = function (t, a) {
var arr, x = {}, subArr, result;
arr = ["foo", undefined, 0, "2d", false, x, null];
a.deep(t.call(arr, Boolean), ["foo", "2d", x], "Plain array");
subArr = new SubArray("foo", undefined, 0, "2d", false, x, null);
result = t.call(subArr, Boolean);
a(result instanceof SubArray, true, "Instance of subclass");
a.deep(result, ["foo", "2d", x], "Result of subclass");
};

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../array/#/find-index/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

View file

@ -0,0 +1,23 @@
"use strict";
exports.__generic = function (t, a) {
var count = 0, o = {}, self = Object(this);
a(
t.call(
self,
function (value, i, scope) {
a(value, this[i], "Value");
a(i, count++, "Index");
a(scope, this, "Scope");
},
self
),
-1,
"Falsy result"
);
a(count, 3);
count = -1;
a(t.call(this, function () { return ++count ? o : null; }, this), 1, "Truthy result");
a(count, 1);
};

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../array/#/find/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

3
web/node_modules/es5-ext/test/array/#/find/index.js generated vendored Normal file
View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

23
web/node_modules/es5-ext/test/array/#/find/shim.js generated vendored Normal file
View file

@ -0,0 +1,23 @@
"use strict";
exports.__generic = function (t, a) {
var count = 0, o = {}, self = Object(this);
a(
t.call(
self,
function (value, i, scope) {
a(value, this[i], "Value");
a(i, count++, "Index");
a(scope, this, "Scope");
},
self
),
undefined,
"Falsy result"
);
a(count, 3);
count = -1;
a(t.call(this, function () { return ++count ? o : null; }, this), this[1], "Truthy result");
a(count, 1);
};

17
web/node_modules/es5-ext/test/array/#/first-index.js generated vendored Normal file
View file

@ -0,0 +1,17 @@
"use strict";
module.exports = function (t, a) {
var x;
a(t.call([]), null, "Empty");
a(t.call([null]), 0, "One value");
a(t.call([1, 2, 3]), 0, "Many values");
a(t.call(new Array(1000)), null, "Sparse empty");
x = [];
x[883] = undefined;
x[890] = null;
a(t.call(x), 883, "Manual sparse, distant value");
x = new Array(1000);
x[657] = undefined;
x[700] = null;
a(t.call(x), 657, "Sparse, distant value");
};

11
web/node_modules/es5-ext/test/array/#/first.js generated vendored Normal file
View file

@ -0,0 +1,11 @@
"use strict";
exports.__generic = function (t, a) { a(t.call(this), this[0]); };
exports[""] = function (t, a) {
var x;
a(t.call([]), undefined, "Empty");
a(t.call(new Array(234), undefined, "Sparse empty"));
x = new Array(2342);
x[434] = {};
a(t.call(x), x[434], "Sparse");
};

12
web/node_modules/es5-ext/test/array/#/flatten.js generated vendored Normal file
View file

@ -0,0 +1,12 @@
"use strict";
var o = [1, 2, [3, 4, [5, 6], 7, 8], 9, 10, [11, 12, [13, 14]], 15];
module.exports = {
"__generic": function (t, a) { a(t.call(this).length, 3); },
"Nested Arrays": function (t, a) {
var result = t.call(o);
a.not(o, result);
a.deep(result, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);
}
};

View file

@ -0,0 +1,39 @@
"use strict";
module.exports = {
"__generic": function (t, a) {
var count = 0, first, last, x, icount = this.length;
t.call(this, function (item, index, col) {
++count;
if (!first) {
first = item;
}
last = item;
x = col;
a(index, --icount, "Index");
});
a(count, this.length, "Iterated");
a(first, this[this.length - 1], "First is last");
a(last, this[0], "Last is first");
a.deep(x, Object(this), "Collection as third argument"); // Jslint: skip
},
"": function (t, a) {
var x = {}, y, count;
t.call([1], function () { y = this; }, x);
a(y, x, "Scope");
y = 0;
t.call([3, 4, 4], function (a, i) { y += i; });
a(y, 3, "Indexes");
x = [1, 3];
x[5] = "x";
y = 0;
count = 0;
t.call(x, function (a, i) {
++count;
y += i;
});
a(y, 6, "Misssing Indexes");
a(count, 3, "Misssing Indexes, count");
}
};

30
web/node_modules/es5-ext/test/array/#/group.js generated vendored Normal file
View file

@ -0,0 +1,30 @@
"use strict";
module.exports = {
"__generic": function (t, a) {
var count = 0, self;
self = Object(this);
a.deep(
t.call(
self,
function (v, i, scope) {
a(v, this[i], "Value");
a(i, count++, "Index");
a(scope, this, "Scope");
return i;
},
self
),
{ 0: [this[0]], 1: [this[1]], 2: [this[2]] }
);
},
"": function (t, a) {
var r;
r = t.call([2, 3, 3, 4, 5, 6, 7, 7, 23, 45, 34, 56], function (v) {
return v % 2 ? "odd" : "even";
});
a.deep(r.odd, [3, 3, 5, 7, 7, 23, 45]);
a.deep(r.even, [2, 4, 6, 34, 56]);
}
};

12
web/node_modules/es5-ext/test/array/#/indexes-of.js generated vendored Normal file
View file

@ -0,0 +1,12 @@
"use strict";
module.exports = {
"__generic": function (t, a) { a.deep(t.call(this, this[1]), [1]); },
"": function (t, a) {
var x = {};
a.deep(t.call([1, 3, 5, 3, 5], 6), [], "No result");
a.deep(t.call([1, 3, 5, 1, 3, 5, 1], 1), [0, 3, 6], "Some results");
a.deep(t.call([], x), [], "Empty array");
a.deep(t.call([x, 3, {}, x, 3, 5, x], x), [0, 3, 6], "Search for object");
}
};

25
web/node_modules/es5-ext/test/array/#/intersection.js generated vendored Normal file
View file

@ -0,0 +1,25 @@
"use strict";
var toArray = require("../../../array/to-array");
module.exports = {
"__generic": function (t, a) { a.deep(t.call(this, this, this), toArray(this)); },
"": function (t, a) {
var x = {}, y = {}, p, r;
a.deep(t.call([], [2, 3, 4]), [], "Empty #1");
a.deep(t.call([2, 3, 4], []), [], "Empty #2");
a.deep(t.call([2, 3, x], [y, 5, 7]), [], "Different");
p = t.call(
[3, 5, "raz", {}, "dwa", x], [1, 3, "raz", "dwa", "trzy", x, {}], [3, "raz", x, 65]
);
r = [3, "raz", x];
p.sort();
r.sort();
a.deep(p, r, "Same parts");
a.deep(t.call(r, r), r, "Same");
a.deep(
t.call([1, 2, x, 4, 5, y, 7], [7, y, 5, 4, x, 2, 1]), [1, 2, x, 4, 5, y, 7],
"Long reverse same"
);
}
};

12
web/node_modules/es5-ext/test/array/#/is-copy.js generated vendored Normal file
View file

@ -0,0 +1,12 @@
"use strict";
module.exports = function (t, a) {
var x = {};
a(t.call([], []), true, "Empty");
a(t.call([], {}), true, "Empty lists");
a(t.call([1, x, "raz"], [1, x, "raz"]), true, "Same");
a(t.call([1, x, "raz"], { 0: 1, 1: x, 2: "raz", length: 3 }), true, "Same lists");
a(t.call([1, x, "raz"], [x, 1, "raz"]), false, "Diff order");
a(t.call([1, x], [1, x, "raz"]), false, "Diff length #1");
a(t.call([1, x, "raz"], [1, x]), false, "Diff length #2");
};

8
web/node_modules/es5-ext/test/array/#/is-empty.js generated vendored Normal file
View file

@ -0,0 +1,8 @@
"use strict";
module.exports = function (t, a) {
var x = {};
a(t.call([]), true, "Empty");
a(t.call({ length: 0 }), true, "Empty lists");
a(t.call([1, x, "raz"]), false, "Non empty");
};

11
web/node_modules/es5-ext/test/array/#/is-uniq.js generated vendored Normal file
View file

@ -0,0 +1,11 @@
"use strict";
module.exports = function (t, a) {
var x = {};
a(t.call([]), true, "Empty");
a(t.call({}), true, "Empty lists");
a(t.call([1, x, "raz"]), true, "Uniq");
a(t.call([1, x, 1, "raz"]), false, "Not Uniq: primitive");
a(t.call([1, x, "1", "raz"]), true, "Uniq: primitive");
a(t.call([1, x, 1, {}, "raz"]), false, "Not Uniq: Obj");
};

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../array/#/keys/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

3
web/node_modules/es5-ext/test/array/#/keys/index.js generated vendored Normal file
View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

9
web/node_modules/es5-ext/test/array/#/keys/shim.js generated vendored Normal file
View file

@ -0,0 +1,9 @@
"use strict";
exports.__generic = function (t, a) {
var iterator = t.call(this);
a.deep(iterator.next(), { value: 0, done: false });
a.deep(iterator.next(), { value: 1, done: false });
a.deep(iterator.next(), { value: 2, done: false });
a.deep(iterator.next(), { value: undefined, done: true });
};

17
web/node_modules/es5-ext/test/array/#/last-index.js generated vendored Normal file
View file

@ -0,0 +1,17 @@
"use strict";
module.exports = function (t, a) {
var x;
a(t.call([]), null, "Empty");
a(t.call([null]), 0, "One value");
a(t.call([1, 2, 3]), 2, "Many values");
a(t.call(new Array(1000)), null, "Sparse empty");
x = [];
x[883] = null;
x[890] = undefined;
a(t.call(x), 890, "Manual sparse, distant value");
x = new Array(1000);
x[657] = null;
x[700] = undefined;
a(t.call(x), 700, "Sparse, distant value");
};

13
web/node_modules/es5-ext/test/array/#/last.js generated vendored Normal file
View file

@ -0,0 +1,13 @@
"use strict";
exports.__generic = function (t, a) { a(t.call(this), this[this.length - 1]); };
exports[""] = function (t, a) {
var x;
a(t.call([]), undefined, "Empty");
a(t.call(new Array(234), undefined, "Sparse empty"));
x = new Array(2342);
x[434] = {};
x[450] = {};
a(t.call(x), x[450], "Sparse");
};

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../array/#/map/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

3
web/node_modules/es5-ext/test/array/#/map/index.js generated vendored Normal file
View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

17
web/node_modules/es5-ext/test/array/#/map/shim.js generated vendored Normal file
View file

@ -0,0 +1,17 @@
"use strict";
var SubArray = require("../../../../array/_sub-array-dummy-safe");
module.exports = function (t, a) {
var arr, x = {}, subArr, result;
arr = ["foo", undefined, 0, "2d", false, x, null];
a.deep(t.call(arr, Boolean), [true, false, false, true, false, true, false], "Plain array");
subArr = new SubArray("foo", undefined, 0, "2d", false, x, null);
result = t.call(subArr, Boolean);
a(result instanceof SubArray, true, "Instance of subclass");
a.deep(result, [true, false, false, true, false, true, false], "Result of subclass");
};

14
web/node_modules/es5-ext/test/array/#/remove.js generated vendored Normal file
View file

@ -0,0 +1,14 @@
"use strict";
module.exports = function (t, a) {
var y = {}, z = {}, x = [9, z, 5, y, "foo"];
t.call(x, y);
a.deep(x, [9, z, 5, "foo"]);
t.call(x, {});
a.deep(x, [9, z, 5, "foo"], "Not existing");
t.call(x, 5);
a.deep(x, [9, z, "foo"], "Primitive");
x = [9, z, 5, y, "foo"];
t.call(x, z, 5, "foo");
a.deep(x, [9, y], "More than one argument");
};

15
web/node_modules/es5-ext/test/array/#/separate.js generated vendored Normal file
View file

@ -0,0 +1,15 @@
"use strict";
module.exports = function (t, a) {
var x = [], y = {}, z = {};
a.deep(t.call(x, y), [], "Empty");
a.not(t.call(x), x, "Returns copy");
a.deep(t.call([1], y), [1], "One");
a.deep(t.call([1, "raz"], y), [1, y, "raz"], "One");
a.deep(t.call([1, "raz", x], y), [1, y, "raz", y, x], "More");
x = new Array(1000);
x[23] = 2;
x[3453] = "raz";
x[500] = z;
a.deep(t.call(x, y), [2, y, z, y, "raz"], "Sparse");
};

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../array/#/slice/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

3
web/node_modules/es5-ext/test/array/#/slice/index.js generated vendored Normal file
View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

17
web/node_modules/es5-ext/test/array/#/slice/shim.js generated vendored Normal file
View file

@ -0,0 +1,17 @@
"use strict";
var SubArray = require("../../../../array/_sub-array-dummy-safe");
module.exports = function (t, a) {
var arr, x = {}, subArr, result;
arr = ["foo", undefined, 0, "2d", false, x, null];
a.deep(t.call(arr, 2, 4), [0, "2d"], "Plain array: result");
subArr = new SubArray("foo", undefined, 0, "2d", false, x, null);
result = t.call(subArr, 2, 4);
a(result instanceof SubArray, true, "Instance of subclass");
a.deep(result, [0, "2d"], "Subclass: result");
};

54
web/node_modules/es5-ext/test/array/#/some-right.js generated vendored Normal file
View file

@ -0,0 +1,54 @@
"use strict";
module.exports = {
"__generic": function (t, a) {
var count = 0, first, last, x, icount = this.length;
t.call(this, function (item, index, col) {
++count;
if (!first) {
first = item;
}
last = item;
x = col;
a(index, --icount, "Index");
});
a(count, this.length, "Iterated");
a(first, this[this.length - 1], "First is last");
a(last, this[0], "Last is first");
a.deep(x, Object(this), "Collection as third argument"); // Jslint: skip
},
"": function (t, a) {
var x = {}, y, count;
t.call([1], function () { y = this; }, x);
a(y, x, "Scope");
y = 0;
t.call([3, 4, 4], function (a, i) { y += i; });
a(y, 3, "Indexes");
x = [1, 3];
x[5] = "x";
y = 0;
count = 0;
a(
t.call(x, function (a, i) {
++count;
y += i;
}),
false,
"Return"
);
a(y, 6, "Misssing Indexes");
a(count, 3, "Misssing Indexes, count");
count = 0;
a(
t.call([-2, -3, -4, 2, -5], function (item) {
++count;
return item > 0;
}),
true,
"Return"
);
a(count, 2, "Break after true is returned");
}
};

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../array/#/splice/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

19
web/node_modules/es5-ext/test/array/#/splice/shim.js generated vendored Normal file
View file

@ -0,0 +1,19 @@
"use strict";
var SubArray = require("../../../../array/_sub-array-dummy-safe");
module.exports = function (t, a) {
var arr, x = {}, subArr, result;
arr = ["foo", undefined, 0, "2d", false, x, null];
a.deep(t.call(arr, 2, 2, "bar"), [0, "2d"], "Plain array: result");
a.deep(arr, ["foo", undefined, "bar", false, x, null], "Plain array: change");
subArr = new SubArray("foo", undefined, 0, "2d", false, x, null);
result = t.call(subArr, 2, 2, "bar");
a(result instanceof SubArray, true, "Instance of subclass");
a.deep(result, [0, "2d"], "Subclass: result");
a.deep(subArr, ["foo", undefined, "bar", false, x, null], "Subclass: change");
};

12
web/node_modules/es5-ext/test/array/#/uniq.js generated vendored Normal file
View file

@ -0,0 +1,12 @@
"use strict";
module.exports = {
"__generic": function (t, a) { a(t.call(this).length, 3); },
"": function (t, a) {
var o, x = {}, y = {}, z = {}, w;
o = [1, 2, x, 3, 1, "raz", "1", y, x, "trzy", z, "raz"];
a.not((w = t.call(o)), o, "Returns different object");
a.deep(w, [1, 2, x, 3, "raz", "1", y, "trzy", z], "Result");
}
};

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../../array/#/values/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

9
web/node_modules/es5-ext/test/array/#/values/shim.js generated vendored Normal file
View file

@ -0,0 +1,9 @@
"use strict";
exports.__generic = function (t, a) {
var iterator = t.call(this);
a.deep(iterator.next(), { value: "1", done: false });
a.deep(iterator.next(), { value: "2", done: false });
a.deep(iterator.next(), { value: "3", done: false });
a.deep(iterator.next(), { value: undefined, done: true });
};

9
web/node_modules/es5-ext/test/array/__scopes.js generated vendored Normal file
View file

@ -0,0 +1,9 @@
"use strict";
exports.Array = ["1", "2", "3"];
exports.Arguments = (function () { return arguments; })("1", "2", "3");
exports.String = "123";
exports.Object = { 0: "1", 1: "2", 2: "3", 3: "4", length: 3 };

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t, "boolean"); };

View file

@ -0,0 +1,5 @@
"use strict";
var isArray = Array.isArray;
module.exports = function (t) { t(t === null || isArray(t.prototype), true); };

View file

@ -0,0 +1,5 @@
"use strict";
var isArray = Array.isArray;
module.exports = function (t) { t(t === null || isArray(t.prototype), true); };

View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../array/from/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

3
web/node_modules/es5-ext/test/array/from/index.js generated vendored Normal file
View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

64
web/node_modules/es5-ext/test/array/from/shim.js generated vendored Normal file
View file

@ -0,0 +1,64 @@
// Some tests taken from: https://github.com/mathiasbynens/Array.from/blob/master/tests/tests.js
"use strict";
module.exports = function (t, a) {
var o = [1, 2, 3], MyType;
a.not(t(o), o, "Array");
a.deep(t(o), o, "Array: same content");
a.deep(t("12r3v"), ["1", "2", "r", "3", "v"], "String");
a.deep(t((function () { return arguments; })(3, o, "raz")), [3, o, "raz"], "Arguments");
a.deep(t((function () { return arguments; })(3)), [3], "Arguments with one numeric value");
a.deep(t({ 0: "raz", 1: "dwa", length: 2 }), ["raz", "dwa"], "Other");
a.deep(t(o, function (val) { return (val + 2) * 10; }, 10), [30, 40, 50], "Mapping");
a.throws(function () { t(); }, TypeError, "Undefined");
a.deep(t(3), [], "Primitive");
a(t.length, 1, "Length");
a.deep(t({ length: 0 }), [], "No values Array-like");
a.deep(t({ length: -1 }), [], "Invalid length Array-like");
a.deep(t({ length: -Infinity }), [], "Invalid length Array-like #2");
a.throws(function () { t(undefined); }, TypeError, "Undefined");
a.throws(function () { t(null); }, TypeError, "Null");
a.deep(t(false), [], "Boolean");
a.deep(t(-Infinity), [], "Inifity");
a.deep(t(-0), [], "-0");
a.deep(t(+0), [], "+0");
a.deep(t(1), [], "1");
a.deep(t(Number(Infinity)), [], "+Infinity");
a.deep(t({}), [], "Plain object");
a.deep(t({ length: 1 }), [undefined], "Sparse array-like");
a.deep(t({ 0: "a", 1: "b", length: 2 }, function (x) { return x + x; }), ["aa", "bb"], "Map");
a.deep(
t({ 0: "a", 1: "b", length: 2 }, function () { return String(this); }, undefined),
["undefined", "undefined"], "Map context"
);
a.deep(
t({ 0: "a", 1: "b", length: 2 }, function () { return String(this); }, "x"), ["x", "x"],
"Map primitive context"
);
a.throws(function () { t({}, "foo", "x"); }, TypeError, "Non callable for map");
a.deep(t({ length: 1, 0: "a" }), ["a"], "Null context");
a(t({ __proto__: { 0: "abc", length: 1 } })[0], "abc", "Values on prototype");
a.throws(
function () {
t.call(function () { return Object.freeze({}); }, {});
},
TypeError,
"Contructor producing freezed objects"
);
// Ensure no setters are called for the indexes
// Ensure no setters are called for the indexes
MyType = function () {};
Object.defineProperty(MyType.prototype, "0", {
set: function (x) { throw new Error("Setter called: " + x); }
});
a.deep(t.call(MyType, { 0: "abc", length: 1 }), { 0: "abc", length: 1 }, "Defined not set");
};

10
web/node_modules/es5-ext/test/array/generate.js generated vendored Normal file
View file

@ -0,0 +1,10 @@
"use strict";
module.exports = function (t, a) {
var x = {}, y = {};
a.deep(t(3), [undefined, undefined, undefined], "Just length");
a.deep(t(0, "x"), [], "No repeat");
a.deep(t(1, x, y), [x], "Arguments length larger than repeat number");
a.deep(t(3, x), [x, x, x], "Single argument");
a.deep(t(5, x, y), [x, y, x, y, x], "Many arguments");
};

18
web/node_modules/es5-ext/test/array/is-plain-array.js generated vendored Normal file
View file

@ -0,0 +1,18 @@
"use strict";
var SubArray = require("../../array/_sub-array-dummy-safe");
module.exports = function (t, a) {
var arr = [1, 2, 3];
a(t(arr), true, "Array");
a(t(null), false, "Null");
a(t(), false, "Undefined");
a(t("234"), false, "String");
a(t(23), false, "Number");
a(t({}), false, "Plain object");
a(t({ length: 1, 0: "raz" }), false, "Array-like");
a(t(Object.create(arr)), false, "Array extension");
if (!SubArray) return;
a(t(new SubArray(23)), false, "Subclass instance");
a(t(Array.prototype), false, "Array.prototype");
};

5
web/node_modules/es5-ext/test/array/of/implement.js generated vendored Normal file
View file

@ -0,0 +1,5 @@
"use strict";
var isImplemented = require("../../../array/of/is-implemented");
module.exports = function (a) { a(isImplemented(), true); };

3
web/node_modules/es5-ext/test/array/of/index.js generated vendored Normal file
View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

81
web/node_modules/es5-ext/test/array/of/shim.js generated vendored Normal file
View file

@ -0,0 +1,81 @@
/* eslint no-useless-call: "off" */
// Most tests taken from https://github.com/mathiasbynens/Array.of/blob/master/tests/tests.js
// Thanks @mathiasbynens
"use strict";
var defineProperty = Object.defineProperty;
module.exports = function (t, a) {
var x = {}, testObject, MyType;
a.deep(t(), [], "No arguments");
a.deep(t(3), [3], "One numeric argument");
a.deep(t(3, "raz", null, x, undefined), [3, "raz", null, x, undefined], "Many arguments");
a(t.length, 0, "Length");
a.deep(t("abc"), ["abc"], "String");
a.deep(t(undefined), [undefined], "Undefined");
a.deep(t(null), [null], "Null");
a.deep(t(false), [false], "Boolean");
a.deep(t(-Infinity), [-Infinity], "Infinity");
a.deep(t(-0), [-0], "-0");
a.deep(t(+0), [+0], "+0");
a.deep(t(1), [1], "1");
a.deep(t(1, 2, 3), [1, 2, 3], "Numeric args");
a.deep(t(Number(Infinity)), [Number(Infinity)], "+Infinity");
a.deep(
t({ 0: "a", 1: "b", 2: "c", length: 3 }), [{ 0: "a", 1: "b", 2: "c", length: 3 }],
"Array like"
);
a.deep(
t(undefined, null, false, -Infinity, -0, +0, 1, 2, Number(Infinity)),
[undefined, null, false, -Infinity, -0, +0, 1, 2, Number(Infinity)], "Falsy arguments"
);
a.h1("Null context");
a.deep(t.call(null, "abc"), ["abc"], "String");
a.deep(t.call(null, undefined), [undefined], "Undefined");
a.deep(t.call(null, null), [null], "Null");
a.deep(t.call(null, false), [false], "Boolean");
a.deep(t.call(null, -Infinity), [-Infinity], "-Infinity");
a.deep(t.call(null, -0), [-0], "-0");
a.deep(t.call(null, +0), [+0], "+0");
a.deep(t.call(null, 1), [1], "1");
a.deep(t.call(null, 1, 2, 3), [1, 2, 3], "Numeric");
a.deep(t.call(null, Number(Infinity)), [Number(Infinity)], "+Infinity");
a.deep(
t.call(null, { 0: "a", 1: "b", 2: "c", length: 3 }),
[{ 0: "a", 1: "b", 2: "c", length: 3 }], "Array-like"
);
a.deep(
t.call(null, undefined, null, false, -Infinity, -0, +0, 1, 2, Number(Infinity)),
[undefined, null, false, -Infinity, -0, +0, 1, 2, Number(Infinity)], "Falsy"
);
a.h1("Other constructor context");
a.deep(t.call(Object, 1, 2, 3), { 0: 1, 1: 2, 2: 3, length: 3 }, "Many arguments");
testObject = Object(3);
testObject[0] = 1;
testObject[1] = 2;
testObject[2] = 3;
testObject.length = 3;
a.deep(t.call(Object, 1, 2, 3), testObject, "Test object");
a(t.call(Object).length, 0, "No arguments");
a.throws(
function () {
t.call(function () { return Object.freeze({}); });
},
TypeError,
"Frozen instance"
);
// Ensure no setters are called for the indexes
MyType = function () {};
defineProperty(MyType.prototype, "0", {
set: function (x) { throw new Error("Setter called: " + x); }
});
a.deep(t.call(MyType, "abc"), { 0: "abc", length: 1 }, "Define, not set");
};

11
web/node_modules/es5-ext/test/array/to-array.js generated vendored Normal file
View file

@ -0,0 +1,11 @@
"use strict";
module.exports = function (t, a) {
var o = [1, 2, 3];
a(t(o), o, "Array");
a.deep(t("12r3v"), ["1", "2", "r", "3", "v"], "String");
a.deep(t((function () { return arguments; })(3, o, "raz")), [3, o, "raz"], "Arguments");
a.deep(t((function () { return arguments; })(3)), [3], "Arguments with one numeric value");
a.deep(t({ 0: "raz", 1: "dwa", length: 2 }), ["raz", "dwa"], "Other");
};

20
web/node_modules/es5-ext/test/array/valid-array.js generated vendored Normal file
View file

@ -0,0 +1,20 @@
"use strict";
module.exports = function (t, a) {
var x;
a.throws(function () { t(); }, TypeError, "Undefined");
a.throws(function () { t(null); }, TypeError, "Null");
a.throws(function () { t(0); }, TypeError, "Number");
a.throws(function () { t(true); }, TypeError, "Boolean");
a.throws(function () { t("raz"); }, TypeError, "String");
a.throws(
function () {
t(function () {});
},
TypeError,
"Function"
);
a.throws(function () { t({}); }, TypeError, "Object");
a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like");
a(t((x = [])), x, "Array");
};