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.set.js 1.0KB

123456789101112131415161718192021222324252627
  1. 'use strict';
  2. var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
  3. var toLength = require('../internals/to-length');
  4. var toOffset = require('../internals/to-offset');
  5. var toObject = require('../internals/to-object');
  6. var fails = require('../internals/fails');
  7. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  8. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  9. var FORCED = fails(function () {
  10. // eslint-disable-next-line es/no-typed-arrays -- required for testing
  11. new Int8Array(1).set({});
  12. });
  13. // `%TypedArray%.prototype.set` method
  14. // https://tc39.es/ecma262/#sec-%typedarray%.prototype.set
  15. exportTypedArrayMethod('set', function set(arrayLike /* , offset */) {
  16. aTypedArray(this);
  17. var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1);
  18. var length = this.length;
  19. var src = toObject(arrayLike);
  20. var len = toLength(src.length);
  21. var index = 0;
  22. if (len + offset > length) throw RangeError('Wrong length');
  23. while (index < len) this[offset + index] = src[index++];
  24. }, FORCED);