summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Libraries/LibJS/Runtime/GlobalObject.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibJS/Runtime/GlobalObject.cpp b/Libraries/LibJS/Runtime/GlobalObject.cpp
index 3ebbb2665f..6cddc07568 100644
--- a/Libraries/LibJS/Runtime/GlobalObject.cpp
+++ b/Libraries/LibJS/Runtime/GlobalObject.cpp
@@ -153,6 +153,8 @@ Value GlobalObject::is_finite(Interpreter& interpreter)
Value GlobalObject::parse_float(Interpreter& interpreter)
{
+ if (interpreter.argument(0).is_number())
+ return interpreter.argument(0);
auto string = interpreter.argument(0).to_string(interpreter);
if (interpreter.exception())
return {};