mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibJS: Simplify a Value type check in Object::to_string()
This commit is contained in:
parent
a82419469f
commit
025cdfdce8
Notes:
sideshowbarker
2024-07-19 06:56:06 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/025cdfdce8b
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