.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / modules / es.number.to-precision.js
1 'use strict';
2 var $ = require('../internals/export');
3 var fails = require('../internals/fails');
4 var thisNumberValue = require('../internals/this-number-value');
5
6 var nativeToPrecision = 1.0.toPrecision;
7
8 var FORCED = fails(function () {
9   // IE7-
10   return nativeToPrecision.call(1, undefined) !== '1';
11 }) || !fails(function () {
12   // V8 ~ Android 4.3-
13   nativeToPrecision.call({});
14 });
15
16 // `Number.prototype.toPrecision` method
17 // https://tc39.es/ecma262/#sec-number.prototype.toprecision
18 $({ target: 'Number', proto: true, forced: FORCED }, {
19   toPrecision: function toPrecision(precision) {
20     return precision === undefined
21       ? nativeToPrecision.call(thisNumberValue(this))
22       : nativeToPrecision.call(thisNumberValue(this), precision);
23   }
24 });