项目原始demo,不改动
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 

19 lines
613 B

  1. 'use strict';
  2. var $export = require('./_export');
  3. var $fails = require('./_fails');
  4. var aNumberValue = require('./_a-number-value');
  5. var $toPrecision = 1.0.toPrecision;
  6. $export($export.P + $export.F * ($fails(function () {
  7. // IE7-
  8. return $toPrecision.call(1, undefined) !== '1';
  9. }) || !$fails(function () {
  10. // V8 ~ Android 4.3-
  11. $toPrecision.call({});
  12. })), 'Number', {
  13. toPrecision: function toPrecision(precision) {
  14. var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');
  15. return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);
  16. }
  17. });