.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / modules / es.typed-array.to-locale-string.js
1 'use strict';
2 var global = require('../internals/global');
3 var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
4 var fails = require('../internals/fails');
5
6 var Int8Array = global.Int8Array;
7 var aTypedArray = ArrayBufferViewCore.aTypedArray;
8 var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
9 var $toLocaleString = [].toLocaleString;
10 var $slice = [].slice;
11
12 // iOS Safari 6.x fails here
13 var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () {
14   $toLocaleString.call(new Int8Array(1));
15 });
16
17 var FORCED = fails(function () {
18   return [1, 2].toLocaleString() != new Int8Array([1, 2]).toLocaleString();
19 }) || !fails(function () {
20   Int8Array.prototype.toLocaleString.call([1, 2]);
21 });
22
23 // `%TypedArray%.prototype.toLocaleString` method
24 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring
25 exportTypedArrayMethod('toLocaleString', function toLocaleString() {
26   return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice.call(aTypedArray(this)) : aTypedArray(this), arguments);
27 }, FORCED);