UNPKG

713 BJavaScriptView Raw
1'use strict';
2var uncurryThis = require('../internals/function-uncurry-this');
3var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
4var $ArrayCopyWithin = require('../internals/array-copy-within');
5
6var u$ArrayCopyWithin = uncurryThis($ArrayCopyWithin);
7var aTypedArray = ArrayBufferViewCore.aTypedArray;
8var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
9
10// `%TypedArray%.prototype.copyWithin` method
11// https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin
12exportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */) {
13 return u$ArrayCopyWithin(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
14});