mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
LibJS: Simplify a Value type check in Object::to_string()
This commit is contained in:
parent
a82419469f
commit
025cdfdce8
1 changed files with 1 additions and 1 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Reference in a new issue