1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 10:37:45 +00:00

LibJS/Bytecode: Don't choke on MemberExpression with PrivateIdentifier

This commit is contained in:
Andreas Kling 2023-06-15 12:38:28 +02:00
parent d063f35afd
commit 8a3e350321
2 changed files with 8 additions and 1 deletions

View file

@ -3289,6 +3289,8 @@ DeprecatedString MemberExpression::to_string_approximation() const
object_string = static_cast<Identifier const&>(*m_object).string();
if (is_computed())
return DeprecatedString::formatted("{}[<computed>]", object_string);
if (is<PrivateIdentifier>(*m_property))
return DeprecatedString::formatted("{}.{}", object_string, verify_cast<PrivateIdentifier>(*m_property).string());
return DeprecatedString::formatted("{}.{}", object_string, verify_cast<Identifier>(*m_property).string());
}