From 3e65afa41a24ffb635265020f411f19fda3e9bdc Mon Sep 17 00:00:00 2001 From: Hendiadyoin1 Date: Sun, 2 Oct 2022 11:51:17 +0200 Subject: [PATCH] LibJS: Show class name in the dump from the NewClass instruction --- Userland/Libraries/LibJS/Bytecode/Op.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Bytecode/Op.cpp b/Userland/Libraries/LibJS/Bytecode/Op.cpp index 58be7e29d6..07adf1fe6c 100644 --- a/Userland/Libraries/LibJS/Bytecode/Op.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Op.cpp @@ -1155,7 +1155,8 @@ String NewFunction::to_string_impl(Bytecode::Executable const&) const String NewClass::to_string_impl(Bytecode::Executable const&) const { - return "NewClass"; + auto name = m_class_expression.name(); + return String::formatted("NewClass '{}'", name.is_null() ? ""sv : name); } String Return::to_string_impl(Bytecode::Executable const&) const