Bug 1896390 - Add getter for Iterator.constructor to eager-ecma-allowlist.js; r=nchev...
[gecko.git] / js / src / tests / test262 / built-ins / Number / prototype / toString / numeric-literal-tostring-default-radix.js
blob23c08abc7c3d4b0335709a6ec5b6dd82556b0bd0
1 // Copyright 2020 Rick Waldron.  All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 esid: sec-number.prototype.tostring
6 description: >
7   If radix is undefined the Number 10 is used as the value of radix.
8 info: |
9   If radix is undefined, let radixNumber be 10.
10   ...
11   If radixNumber = 10, return ! ToString(x).
12   Return the String representation of this Number value using the radix specified by radixNumber. Letters a-z are used for digits with values 10 through 35. The precise algorithm is implementation-defined, however the algorithm should be a generalization of that specified in 6.1.6.1.20.
14   The optional radix should be an integer value in the inclusive range 2 to 36. If radix is undefined the Number 10 is used as the value of radix.
15 ---*/
17 assert.sameValue(0..toString(), "0");
18 assert.sameValue(1..toString(), "1");
19 assert.sameValue(NaN.toString(), "NaN");
20 assert.sameValue(Infinity.toString(), "Infinity");
22 reportCompare(0, 0);