mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-19 09:51:33 +00:00
Fix parsing numbers with padded whitespaces (#607)
This commit is contained in:
@ -547,6 +547,11 @@ export function parseFloat(str: String): f64 {
|
||||
|
||||
// determine sign
|
||||
var sign: f64;
|
||||
// trim white spaces
|
||||
while (isWhiteSpaceOrLineTerminator(code)) {
|
||||
code = <i32>load<u16>(ptr += 2);
|
||||
--len;
|
||||
}
|
||||
if (code == CharCode.MINUS) {
|
||||
if (!--len) return NaN;
|
||||
code = <i32>load<u16>(ptr += 2);
|
||||
|
Reference in New Issue
Block a user