Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

es.typed-array.subarray.js 895B

123456789101112131415161718192021
  1. 'use strict';
  2. var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
  3. var toLength = require('../internals/to-length');
  4. var toAbsoluteIndex = require('../internals/to-absolute-index');
  5. var speciesConstructor = require('../internals/species-constructor');
  6. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  7. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  8. // `%TypedArray%.prototype.subarray` method
  9. // https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray
  10. exportTypedArrayMethod('subarray', function subarray(begin, end) {
  11. var O = aTypedArray(this);
  12. var length = O.length;
  13. var beginIndex = toAbsoluteIndex(begin, length);
  14. return new (speciesConstructor(O, O.constructor))(
  15. O.buffer,
  16. O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT,
  17. toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex)
  18. );
  19. });