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