mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 13:55:06 +00:00
LibJS: Return -Infinity in Math.max() with no argument
This commit is contained in:
parent
8bfee015bc
commit
9e7dcaa106
2 changed files with 2 additions and 2 deletions
|
@ -126,8 +126,7 @@ Value MathObject::round(Interpreter& interpreter)
|
|||
Value MathObject::max(Interpreter& interpreter)
|
||||
{
|
||||
if (!interpreter.argument_count()) {
|
||||
// FIXME: I think this should return *negative* infinity.
|
||||
return js_infinity();
|
||||
return Value(-js_infinity().as_double());
|
||||
} else if (interpreter.argument_count() == 1) {
|
||||
return interpreter.argument(0).to_number();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue