!294 Fix closure variables display exception

Merge pull request !294 from 杨阳/fix_display_exception
This commit is contained in:
openharmony_ci 2023-06-16 08:40:03 +00:00 committed by Gitee
commit f8d677dbfb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1149,6 +1149,9 @@ void DebuggerImpl::GetClosureVariables(const FrameHandler *frameHandler, Local<J
continue;
}
Local<JSValueRef> 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);
}