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');
|
|
|
|
|
2021-02-26 03:58:33 +00:00
|
|
|
// https://ecma-international.org/ecma-262/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);
|
|
|
|
};
|
|
|
|
|