Sfoglia il codice sorgente

LibJS: Show class name in the dump from the NewClass instruction

Hendiadyoin1 2 anni fa
parent
commit
3e65afa41a
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      Userland/Libraries/LibJS/Bytecode/Op.cpp

+ 2 - 1
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