Closed bptato closed 5 months ago
(I think there is no place where parsing non-decimal floats makes sense; it could be useful for error messages if it really were an error, but it isn't one.)
Hello @bptato,
It would make sense for Javascript to accept hexadecimal floats such as 0x0.8
(one half) or 0x1p-1
(same).
Yet ECMA does not support this syntax and quickjs-ng aims for strictly standard Javascript, so your patch does fix a bug.
Thank you for your contribution
(I have run into a polyfill that depends on this.)
To fix it I just added a base-10 check to the part of js_atof2 which consumes the fraction part.
(I think there is no place where parsing non-decimal floats makes sense; it could be useful for error messages if it really were an error, but it isn't one.)
I've also added some tests to illustrate what should work.