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