blob: b00c4bd59848c7c4e675fee2309ec80e6929ac89 [file] [log] [blame]
Leo Repp58b9f112021-11-22 11:57:47 +01001'use strict';
2
3var GetIntrinsic = require('get-intrinsic');
4
5var $String = GetIntrinsic('%String%');
6var $TypeError = GetIntrinsic('%TypeError%');
7
8var Type = require('./Type');
9
10// https://262.ecma-international.org/9.0/#sec-tostring-applied-to-the-number-type
11
12module.exports = function NumberToString(m) {
13 if (Type(m) !== 'Number') {
14 throw new $TypeError('Assertion failed: "m" must be a String');
15 }
16
17 return $String(m);
18};
19