2 var global = require('../internals/global');
3 var apply = require('../internals/function-apply');
4 var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
5 var fails = require('../internals/fails');
6 var arraySlice = require('../internals/array-slice');
8 var Int8Array = global.Int8Array;
9 var aTypedArray = ArrayBufferViewCore.aTypedArray;
10 var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
11 var $toLocaleString = [].toLocaleString;
13 // iOS Safari 6.x fails here
14 var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () {
15 $toLocaleString.call(new Int8Array(1));
18 var FORCED = fails(function () {
19 return [1, 2].toLocaleString() != new Int8Array([1, 2]).toLocaleString();
20 }) || !fails(function () {
21 Int8Array.prototype.toLocaleString.call([1, 2]);
24 // `%TypedArray%.prototype.toLocaleString` method
25 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring
26 exportTypedArrayMethod('toLocaleString', function toLocaleString() {
29 TO_LOCALE_STRING_BUG ? arraySlice(aTypedArray(this)) : aTypedArray(this),