Clean up radix conversion in Number toString method (#2002)

The radix conversion code path was very messy which made it hard to understand
what was happening inside of it. The code got cleaned up, and a lot of comments
were added that explain what is happening and why.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This commit is contained in:
Dániel Bátyai
2017-09-06 10:56:29 +02:00
committed by GitHub
parent 74045f2964
commit 01dd2f0b2a
2 changed files with 124 additions and 69 deletions
+1 -1
View File
@@ -90,7 +90,7 @@ assert ((-0x100000000000061).toString(16) === "-100000000000060");
assert((123400).toString(new Number(16)) === "1e208");
assert(65535.9.toString(3) === "10022220020.220022002200220022002210211012200000110221");
assert(65535.9.toString(3) === "10022220020.2200220022002200220022102110122000001102212");
var digit_chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',