From 974c9eff75a1108bb0f6dc06e7373ecbf6ef6496 Mon Sep 17 00:00:00 2001 From: Alexey Grinevich Date: Fri, 20 Mar 2026 12:04:15 +0300 Subject: [PATCH] Fix: node process was dying (Check failed: !IsTheHole) when debugger was trying to display an IUnknown object due to missing "__type" return value. --- src/disp.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/disp.cpp b/src/disp.cpp index 08fa1a6..b502f03 100644 --- a/src/disp.cpp +++ b/src/disp.cpp @@ -1104,9 +1104,18 @@ void VariantObject::NodeGet(Local name, const PropertyCallbackInfoGetter& std::wstring type, name; if (self->value.vt & VT_BYREF) type += L"byref:"; if (self->value.vt & VT_ARRAY) type = L"array:"; - if (vtypes.find(self->value.vt & VT_TYPEMASK, name)) type += name; - else type += std::to_wstring(self->value.vt & VT_TYPEMASK); + if (vtypes.find(self->value.vt & VT_TYPEMASK, name)) { + type += name; + } + else if (self->value.vt & VT_UNKNOWN) { + type += L"IUnknown"; + } + else { + type += std::to_wstring(self->value.vt & VT_TYPEMASK); + } Local text = v8str(isolate, type.c_str()); + // Debugger was crashing on IUnknown due to missing return value here + args.GetReturnValue().Set(text); } else if (_wcsicmp(id, L"__proto__") == 0) { Local func; @@ -1123,10 +1132,10 @@ void VariantObject::NodeGet(Local name, const PropertyCallbackInfoGetter& if ((self->value.vt & VT_ARRAY) != 0) { args.GetReturnValue().Set((uint32_t)self->value.ArrayLength()); } - else { - args.GetReturnValue().SetUndefined(); - } - } + else { + args.GetReturnValue().SetUndefined(); + } + } else { Local func; if (clazz_methods.get(isolate, id, &func)) {