source: frontend/node_modules/es-abstract/2025/Number/toString.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 645 bytes
Line 
1'use strict';
2
3var $TypeError = require('es-errors/type');
4var callBound = require('call-bound');
5var isInteger = require('math-intrinsics/isInteger');
6
7var $numberToString = callBound('Number.prototype.toString');
8
9// https://262.ecma-international.org/14.0/#sec-numeric-types-number-tostring
10
11module.exports = function NumberToString(x, radix) {
12 if (typeof x !== 'number') {
13 throw new $TypeError('Assertion failed: `x` must be a Number');
14 }
15 if (!isInteger(radix) || radix < 2 || radix > 36) {
16 throw new $TypeError('Assertion failed: `radix` must be an integer >= 2 and <= 36');
17 }
18
19 return $numberToString(x, radix); // steps 1 - 12
20};
Note: See TracBrowser for help on using the repository browser.