From 04a36b247bcecb5b072af453bd3bce0e33afb6a8 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 5 Apr 2020 19:15:25 +0100 Subject: LibJS: Simplify MathObject functions --- Libraries/LibJS/Runtime/MathObject.cpp | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'Libraries') 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(); -- cgit v1.2.3