mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
LibJS: Simplify a Value type check in Object::to_string()
This commit is contained in:
@@ -477,7 +477,7 @@ Value Object::to_primitive(PreferredType preferred_type) const
|
||||
Value Object::to_string() const
|
||||
{
|
||||
auto to_string_property = get("toString");
|
||||
if (!to_string_property.is_empty() && to_string_property.is_function()) {
|
||||
if (to_string_property.is_function()) {
|
||||
auto& to_string_function = to_string_property.as_function();
|
||||
auto& interpreter = const_cast<Object*>(this)->interpreter();
|
||||
auto to_string_result = interpreter.call(to_string_function, const_cast<Object*>(this));
|
||||
|
||||
Reference in New Issue
Block a user