1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:17:44 +00:00

LibJS: Flatten Value::to_numeric()

The basic idea here is to inline to_primitive() to get rid of the
function call overhead.
This commit is contained in:
Andreas Kling 2021-03-21 18:13:29 +01:00
parent 00965e3dad
commit 6870349599

View file

@ -413,7 +413,7 @@ Object* Value::to_object(GlobalObject& global_object) const
}
}
Value Value::to_numeric(GlobalObject& global_object) const
FLATTEN Value Value::to_numeric(GlobalObject& global_object) const
{
auto primitive = to_primitive(global_object, Value::PreferredType::Number);
if (global_object.vm().exception())