source: trip-planner-front/node_modules/core-js/modules/es.typed-array.to-locale-string.js@ e29cc2e

Last change on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.0 KB
Line 
1'use strict';
2var global = require('../internals/global');
3var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
4var fails = require('../internals/fails');
5
6var Int8Array = global.Int8Array;
7var aTypedArray = ArrayBufferViewCore.aTypedArray;
8var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
9var $toLocaleString = [].toLocaleString;
10var $slice = [].slice;
11
12// iOS Safari 6.x fails here
13var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () {
14 $toLocaleString.call(new Int8Array(1));
15});
16
17var 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
25exportTypedArrayMethod('toLocaleString', function toLocaleString() {
26 return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice.call(aTypedArray(this)) : aTypedArray(this), arguments);
27}, FORCED);
Note: See TracBrowser for help on using the repository browser.