Sha256: cc82d683a6e79ac49d835e8b9e31c5cfcf1650bbeaaffeff45ca39cb26ddf9e6

Contents?: true

Size: 980 Bytes

Versions: 47

Compression:

Stored size: 980 Bytes

Contents

"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 });
};

Version data entries

47 entries across 47 versions & 3 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-18.0.0 node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-17.21.0 node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-17.20.0 node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-17.19.1 node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-17.19.0 node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-17.18.0 node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-17.17.0 node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-17.16.0 node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-17.15.0 node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-17.14.0 node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-17.13.0 node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-17.12.2 node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-17.12.1 node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-17.12.0 node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-17.11.0 node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-17.10.0 node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-17.9.0 node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-17.8.0 node_modules/es5-ext/test/array/#/copy-within/shim.js
govuk_publishing_components-17.7.0 node_modules/es5-ext/test/array/#/copy-within/shim.js