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 $toLocaleString = [].toLocaleString;
|
9 | var $slice = [].slice;
|
10 |
|
11 |
|
12 | var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () {
|
13 | $toLocaleString.call(new Int8Array(1));
|
14 | });
|
15 |
|
16 | var FORCED = fails(function () {
|
17 | return [1, 2].toLocaleString() != new Int8Array([1, 2]).toLocaleString();
|
18 | }) || !fails(function () {
|
19 | Int8Array.prototype.toLocaleString.call([1, 2]);
|
20 | });
|
21 |
|
22 |
|
23 |
|
24 | ArrayBufferViewCore.exportProto('toLocaleString', function toLocaleString() {
|
25 | return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice.call(aTypedArray(this)) : aTypedArray(this), arguments);
|
26 | }, FORCED);
|