mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-22 11:11:43 +00:00
Fix parsing numbers with padded whitespaces (#607)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -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
Reference in New Issue
Block a user