浏览代码

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

Hendiadyoin1 2 年之前
父节点
当前提交
3e65afa41a
共有 1 个文件被更改,包括 2 次插入1 次删除
  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