f4a30aa9fb39ea00505cafd36efa273691c9e736be9615de4b50abeaf7c7dac2dc62f5cdf7ac7d2526431f98bbd423ad30875ceb6f8359aee302638735b17d 742 B

12345678910111213141516
  1. 'use strict';
  2. var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
  3. var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers');
  4. var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
  5. var exportTypedArrayStaticMethod = ArrayBufferViewCore.exportTypedArrayStaticMethod;
  6. // `%TypedArray%.of` method
  7. // https://tc39.es/ecma262/#sec-%typedarray%.of
  8. exportTypedArrayStaticMethod('of', function of(/* ...items */) {
  9. var index = 0;
  10. var length = arguments.length;
  11. var result = new (aTypedArrayConstructor(this))(length);
  12. while (length > index) result[index] = arguments[index++];
  13. return result;
  14. }, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS);