Sha256: f3dc607b8fa1eade7c543f5fb69fdb154b84ae70464fc7b9e1d2df4aad0bb417

Contents?: true

Size: 986 Bytes

Versions: 15

Compression:

Stored size: 986 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

15 entries across 12 versions & 6 rubygems

Version Path
guard-sass-lint-0.1.2 node_modules/es5-ext/test/array/#/copy-within/shim.js
guard-sass-lint-0.1.1 node_modules/es5-ext/test/array/#/copy-within/shim.js
lanes-0.8.0 node_modules/es5-ext/test/array/#/copy-within/shim.js
node-compiler-0.9.1 vendor/node/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/shim.js
node-compiler-0.9.0 vendor/node-v7.2.1/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/shim.js
node-compiler-0.8.0 vendor/node-v7.2.0/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/shim.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/es5-ext/test/array/#/copy-within/shim.js
node-compiler-0.7.0 vendor/node-v6.9.1/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/shim.js
node-compiler-0.7.0 vendor/node-v7.1.0/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/shim.js
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/es5-ext/test/array/#/copy-within/shim.js
blackboard-3.1.9 lib/site_template/node_modules/es5-ext/test/array/#/copy-within/shim.js
eslint_node_modules-1.6.0.1 vendor/node_modules/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/copy-within/shim.js
eslint_node_modules-1.6.0.1 vendor/node_modules/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/copy-within/shim.js
eslint_node_modules-1.6.0 vendor/node_modules/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/copy-within/shim.js
eslint_node_modules-1.6.0 vendor/node_modules/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/copy-within/shim.js