1 | 'use strict';
|
2 | var global = require('../internals/global');
|
3 | var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
|
4 | var ArrayIterators = require('../modules/es.array.iterator');
|
5 | var wellKnownSymbol = require('../internals/well-known-symbol');
|
6 |
|
7 | var ITERATOR = wellKnownSymbol('iterator');
|
8 | var Uint8Array = global.Uint8Array;
|
9 | var arrayValues = ArrayIterators.values;
|
10 | var arrayKeys = ArrayIterators.keys;
|
11 | var arrayEntries = ArrayIterators.entries;
|
12 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
13 | var exportProto = ArrayBufferViewCore.exportProto;
|
14 | var nativeTypedArrayIterator = Uint8Array && Uint8Array.prototype[ITERATOR];
|
15 |
|
16 | var CORRECT_ITER_NAME = !!nativeTypedArrayIterator
|
17 | && (nativeTypedArrayIterator.name == 'values' || nativeTypedArrayIterator.name == undefined);
|
18 |
|
19 | var typedArrayValues = function values() {
|
20 | return arrayValues.call(aTypedArray(this));
|
21 | };
|
22 |
|
23 |
|
24 |
|
25 | exportProto('entries', function entries() {
|
26 | return arrayEntries.call(aTypedArray(this));
|
27 | });
|
28 |
|
29 |
|
30 | exportProto('keys', function keys() {
|
31 | return arrayKeys.call(aTypedArray(this));
|
32 | });
|
33 |
|
34 |
|
35 | exportProto('values', typedArrayValues, !CORRECT_ITER_NAME);
|
36 |
|
37 |
|
38 | exportProto(ITERATOR, typedArrayValues, !CORRECT_ITER_NAME);
|