summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2020-04-05 19:15:25 +0100
committerAndreas Kling <kling@serenityos.org>2020-04-06 10:58:16 +0200
commit04a36b247bcecb5b072af453bd3bce0e33afb6a8 (patch)
tree95fa295dddbd1ba2d8acdd490d0498179cc20469
parent20e58c5513f7e8c5819ffa149f90760ba37d1a9f (diff)
downloadserenity-04a36b247bcecb5b072af453bd3bce0e33afb6a8.zip
LibJS: Simplify MathObject functions
-rw-r--r--Libraries/LibJS/Runtime/MathObject.cpp18
1 files changed, 0 insertions, 18 deletions
diff --git a/Libraries/LibJS/Runtime/MathObject.cpp b/Libraries/LibJS/Runtime/MathObject.cpp
index cc46ae17fd..19a2e50fb4 100644
--- a/Libraries/LibJS/Runtime/MathObject.cpp
+++ b/Libraries/LibJS/Runtime/MathObject.cpp
@@ -60,9 +60,6 @@ MathObject::~MathObject()
Value MathObject::abs(Interpreter& interpreter)
{
- if (!interpreter.argument_count())
- return js_nan();
-
auto number = interpreter.argument(0).to_number();
if (number.is_nan())
return js_nan();
@@ -81,9 +78,6 @@ Value MathObject::random(Interpreter&)
Value MathObject::sqrt(Interpreter& interpreter)
{
- if (!interpreter.argument_count())
- return js_nan();
-
auto number = interpreter.argument(0).to_number();
if (number.is_nan())
return js_nan();
@@ -92,9 +86,6 @@ Value MathObject::sqrt(Interpreter& interpreter)
Value MathObject::floor(Interpreter& interpreter)
{
- if (!interpreter.argument_count())
- return js_nan();
-
auto number = interpreter.argument(0).to_number();
if (number.is_nan())
return js_nan();
@@ -103,9 +94,6 @@ Value MathObject::floor(Interpreter& interpreter)
Value MathObject::ceil(Interpreter& interpreter)
{
- if (!interpreter.argument_count())
- return js_nan();
-
auto number = interpreter.argument(0).to_number();
if (number.is_nan())
return js_nan();
@@ -114,9 +102,6 @@ Value MathObject::ceil(Interpreter& interpreter)
Value MathObject::round(Interpreter& interpreter)
{
- if (!interpreter.argument_count())
- return js_nan();
-
auto number = interpreter.argument(0).to_number();
if (number.is_nan())
return js_nan();
@@ -158,9 +143,6 @@ Value MathObject::min(Interpreter& interpreter)
Value MathObject::trunc(Interpreter& interpreter)
{
- if (!interpreter.argument_count())
- return js_nan();
-
auto number = interpreter.argument(0).to_number();
if (number.is_nan())
return js_nan();