Fix parsing numbers with padded whitespaces (#607)

This commit is contained in:
Max Graey
2019-05-27 15:37:07 +03:00
committed by Daniel Wirtz
parent 0339d82781
commit 9c51f1332c
5 changed files with 2287 additions and 1988 deletions

File diff suppressed because it is too large Load Diff

View File

@ -76,12 +76,17 @@ assert(parseInt("0xF0F") == 0xf0f);
assert(parseInt("011") == 11); // not octal
assert(parseInt("0x1g") == 1); // not valid
assert(parseInt(" \t\n1") == 1);
assert(parseInt(" \t\n0x02") == 2);
assert(parseFloat("0") == 0);
assert(parseFloat("1") == 1);
assert(parseFloat("0.1") == 0.1);
assert(parseFloat(".25") == 0.25);
assert(parseFloat(".1foobar") == 0.1);
assert(parseFloat(" \t\n.1") == 0.1);
{
let c = "a" + "b";
assert(c == "ab");

File diff suppressed because it is too large Load Diff