mirror of
https://github.com/bellard/quickjs.git
synced 2025-09-29 22:44:25 +03:00
fixed negative zero date
This commit is contained in:
@@ -48100,8 +48100,11 @@ static int string_get_signed_digits(JSString *sp, int *pp, int64_t *pval) {
|
||||
p++;
|
||||
|
||||
res = string_get_digits(sp, &p, pval);
|
||||
if (res == 0 && sgn == '-')
|
||||
if (res == 0 && sgn == '-') {
|
||||
if (*pval == 0)
|
||||
return -1; // reject negative zero
|
||||
*pval = -*pval;
|
||||
}
|
||||
*pp = p;
|
||||
return res;
|
||||
}
|
||||
|
Reference in New Issue
Block a user