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
|
Rev | Line | |
---|
[6a3a178] | 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);
|
---|
Note:
See
TracBrowser
for help on using the repository browser.