diff options
author | Linus Groh <mail@linusgroh.de> | 2020-04-05 17:09:18 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-05 19:30:47 +0200 |
commit | 9e7dcaa106dbd3d4b8e217de8ca32b534c08a456 (patch) | |
tree | cb0a7be05940d7b56c91b4e361a7b75ca7e8c420 /Libraries/LibJS/Runtime | |
parent | 8bfee015bc7d79c7fc3c89edbc88eba503e8ab37 (diff) | |
download | serenity-9e7dcaa106dbd3d4b8e217de8ca32b534c08a456.zip |
LibJS: Return -Infinity in Math.max() with no argument
Diffstat (limited to 'Libraries/LibJS/Runtime')
-rw-r--r-- | Libraries/LibJS/Runtime/MathObject.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Libraries/LibJS/Runtime/MathObject.cpp b/Libraries/LibJS/Runtime/MathObject.cpp index e1f0fae96e..c9390abb74 100644 --- a/Libraries/LibJS/Runtime/MathObject.cpp +++ b/Libraries/LibJS/Runtime/MathObject.cpp @@ -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 { |