mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:27:45 +00:00
LibJS: Add js_negative_infinity()
Value(-js_infinity().as_double()) is kind of awkward.
This commit is contained in:
parent
f226746394
commit
97de93eed1
4 changed files with 17 additions and 12 deletions
|
@ -143,7 +143,7 @@ Value Value::to_number() const
|
|||
if (string == "Infinity" || string == "+Infinity")
|
||||
return js_infinity();
|
||||
if (string == "-Infinity")
|
||||
return Value(-js_infinity().as_double());
|
||||
return js_negative_infinity();
|
||||
bool ok;
|
||||
//FIXME: Parse in a better way
|
||||
auto parsed_int = string.to_int(ok);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue