2020-08-26 01:57:08 +02:00
|
|
|
'use strict';
|
|
|
|
|
2021-02-26 04:58:33 +01:00
|
|
|
var GetIntrinsic = require('get-intrinsic');
|
2020-08-26 01:57:08 +02:00
|
|
|
|
|
|
|
var $String = GetIntrinsic('%String%');
|
2021-02-26 04:58:33 +01:00
|
|
|
var $TypeError = GetIntrinsic('%TypeError%');
|
2020-08-26 01:57:08 +02:00
|
|
|
|
|
|
|
var Type = require('./Type');
|
|
|
|
|
2022-11-10 11:43:16 +01:00
|
|
|
// https://262.ecma-international.org/9.0/#sec-tostring-applied-to-the-number-type
|
2020-08-26 01:57:08 +02:00
|
|
|
|
|
|
|
module.exports = function NumberToString(m) {
|
|
|
|
if (Type(m) !== 'Number') {
|
2021-02-26 04:58:33 +01:00
|
|
|
throw new $TypeError('Assertion failed: "m" must be a String');
|
2020-08-26 01:57:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return $String(m);
|
|
|
|
};
|
|
|
|
|