massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / modules / es.typed-array.iterator.js
1 'use strict';
2 var global = require('../internals/global');
3 var uncurryThis = require('../internals/function-uncurry-this');
4 var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER;
5 var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
6 var ArrayIterators = require('../modules/es.array.iterator');
7 var wellKnownSymbol = require('../internals/well-known-symbol');
8
9 var ITERATOR = wellKnownSymbol('iterator');
10 var Uint8Array = global.Uint8Array;
11 var arrayValues = uncurryThis(ArrayIterators.values);
12 var arrayKeys = uncurryThis(ArrayIterators.keys);
13 var arrayEntries = uncurryThis(ArrayIterators.entries);
14 var aTypedArray = ArrayBufferViewCore.aTypedArray;
15 var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
16 var nativeTypedArrayIterator = Uint8Array && Uint8Array.prototype[ITERATOR];
17
18 var PROPER_ARRAY_VALUES_NAME = !!nativeTypedArrayIterator && nativeTypedArrayIterator.name === 'values';
19
20 var typedArrayValues = function values() {
21   return arrayValues(aTypedArray(this));
22 };
23
24 // `%TypedArray%.prototype.entries` method
25 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.entries
26 exportTypedArrayMethod('entries', function entries() {
27   return arrayEntries(aTypedArray(this));
28 });
29 // `%TypedArray%.prototype.keys` method
30 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys
31 exportTypedArrayMethod('keys', function keys() {
32   return arrayKeys(aTypedArray(this));
33 });
34 // `%TypedArray%.prototype.values` method
35 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.values
36 exportTypedArrayMethod('values', typedArrayValues, PROPER_FUNCTION_NAME && !PROPER_ARRAY_VALUES_NAME);
37 // `%TypedArray%.prototype[@@iterator]` method
38 // https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator
39 exportTypedArrayMethod(ITERATOR, typedArrayValues, PROPER_FUNCTION_NAME && !PROPER_ARRAY_VALUES_NAME);