From b63f70f678b99dc16e6d2f4c70bc65313e34c97c Mon Sep 17 00:00:00 2001 From: yang-19970325 Date: Fri, 16 Jun 2023 11:47:31 +0800 Subject: [PATCH] Fix closure variables display exception1 Issue:#I7DYG2 Signed-off-by: yang-19970325 Change-Id: I5d1b0abce208fb319c20a595929ef93062b4625d --- tooling/agent/debugger_impl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tooling/agent/debugger_impl.cpp b/tooling/agent/debugger_impl.cpp index fecfb8d..7572e81 100644 --- a/tooling/agent/debugger_impl.cpp +++ b/tooling/agent/debugger_impl.cpp @@ -1149,6 +1149,9 @@ void DebuggerImpl::GetClosureVariables(const FrameHandler *frameHandler, Local name = StringRef::NewFromUtf8(vm_, varName.c_str()); + if (value->IsHole()) { + value = JSValueRef::Undefined(vm_); + } PropertyAttribute descriptor(value, true, true, true); localObj->DefineProperty(vm_, name, descriptor); }