number literal evaluation is wrong
dherman opened this issue · 3 comments
There are edge cases in number literal evaluation (NumberSource.value
) that are still wrong. For example, it'll just panic if given too large of an exponent in a decimal literal. I will have to study the spec and real implementations.
For the sake of example, I've runned esprit against all the latest versions of CDNjs libs and such occurences cause esprit to panic:
18446744073709551616
0x8000000000000000
1208925819614629174706176
0x10000000000000000
I'm not sure why someone uses verbatim numbers which can't be represented correctly in JS anyway, but in the worst case this should be a parsing error, and in the best, we should try and simulate engine behaviour by manually parsing into f64
digit by digit.
Fixed the decimal integer cases, radix one still persists and f64::from_str_radix
was removed from Rust core and has to be simulated.
Should be fixed for radix integer cases too now.