Sha256: fc509d5d76ab63b3adcc317a1fa5ce46a78703564824a749c416817ab23f730c

Contents?: true

Size: 995 Bytes

Versions: 6

Compression:

Stored size: 995 Bytes

Contents

'use strict';
var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var speciesConstructor = require('../internals/species-constructor');
var fails = require('../internals/fails');

var aTypedArray = ArrayBufferViewCore.aTypedArray;
var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var $slice = [].slice;

var FORCED = fails(function () {
  // eslint-disable-next-line no-undef
  new Int8Array(1).slice();
});

// `%TypedArray%.prototype.slice` method
// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.slice
exportTypedArrayMethod('slice', function slice(start, end) {
  var list = $slice.call(aTypedArray(this), start, end);
  var C = speciesConstructor(this, this.constructor);
  var index = 0;
  var length = list.length;
  var result = new (aTypedArrayConstructor(C))(length);
  while (length > index) result[index] = list[index++];
  return result;
}, FORCED);

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/core-js/modules/es.typed-array.slice.js
tang-0.2.1 spec/tang_app/node_modules/core-js/modules/es.typed-array.slice.js
tang-0.2.0 spec/tang_app/node_modules/core-js/modules/es.typed-array.slice.js
tang-0.1.0 spec/tang_app/node_modules/core-js/modules/es.typed-array.slice.js
tang-0.0.9 spec/tang_app/node_modules/core-js/modules/es.typed-array.slice.js
enju_library-0.3.8 spec/dummy/node_modules/core-js/modules/es.typed-array.slice.js