Skip to content

Commit

Permalink
fix: "Infinity" not parsed correctly to float64
Browse files Browse the repository at this point in the history
  • Loading branch information
shiqimei committed Jun 14, 2023
1 parent 6cd9a32 commit be4149a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/conversion.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,10 +956,11 @@ JSValue js_atof(JSContext* ctx, const char* str, const char** pp, int radix, int
} else
#endif
{
// Infinity and -Infinity
double d = 1.0 / 0.0;
if (is_neg)
d = -d;
val = JS_NewFloat64(ctx, d);
val = __JS_NewFloat64(ctx, d);
}
goto done;
}
Expand Down

0 comments on commit be4149a

Please sign in to comment.