2 var $ = require('../internals/export');
3 var uncurryThis = require('../internals/function-uncurry-this');
4 var fails = require('../internals/fails');
5 var thisNumberValue = require('../internals/this-number-value');
7 var un$ToPrecision = uncurryThis(1.0.toPrecision);
9 var FORCED = fails(function () {
11 return un$ToPrecision(1, undefined) !== '1';
12 }) || !fails(function () {
17 // `Number.prototype.toPrecision` method
18 // https://tc39.es/ecma262/#sec-number.prototype.toprecision
19 $({ target: 'Number', proto: true, forced: FORCED }, {
20 toPrecision: function toPrecision(precision) {
21 return precision === undefined
22 ? un$ToPrecision(thisNumberValue(this))
23 : un$ToPrecision(thisNumberValue(this), precision);