| Leo Repp | 58b9f11 | 2021-11-22 11:57:47 +0100 | [diff] [blame^] | 1 | 'use strict'; |
| 2 | |||||
| 3 | var GetIntrinsic = require('get-intrinsic'); | ||||
| 4 | |||||
| 5 | var $String = GetIntrinsic('%String%'); | ||||
| 6 | var $TypeError = GetIntrinsic('%TypeError%'); | ||||
| 7 | |||||
| 8 | var Type = require('./Type'); | ||||
| 9 | |||||
| 10 | // https://262.ecma-international.org/9.0/#sec-tostring-applied-to-the-number-type | ||||
| 11 | |||||
| 12 | module.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 | |||||