From 642fb44982a8736834596509c32cc1f29c7cc8cc Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Mon, 27 Nov 2023 14:35:25 +0100 Subject: [PATCH] src: register process_wrap external references PR-URL: https://github.com/nodejs/node/pull/50943 Refs: https://github.com/nodejs/node/issues/50924 Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell --- src/node_external_reference.h | 1 + src/process_wrap.cc | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/node_external_reference.h b/src/node_external_reference.h index 541b73499869e3..86db27e5457cd0 100644 --- a/src/node_external_reference.h +++ b/src/node_external_reference.h @@ -109,6 +109,7 @@ class ExternalReferenceRegistry { V(permission) \ V(process_methods) \ V(process_object) \ + V(process_wrap) \ V(report) \ V(task_queue) \ V(tcp_wrap) \ diff --git a/src/process_wrap.cc b/src/process_wrap.cc index 42a746308ba8ac..a9b0cea29cbd15 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -20,6 +20,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. #include "env-inl.h" +#include "node_external_reference.h" #include "permission/permission.h" #include "stream_base-inl.h" #include "stream_wrap.h" @@ -67,6 +68,12 @@ class ProcessWrap : public HandleWrap { SetConstructorFunction(context, target, "Process", constructor); } + static void RegisterExternalReferences(ExternalReferenceRegistry* registry) { + registry->Register(New); + registry->Register(Spawn); + registry->Register(Kill); + } + SET_NO_MEMORY_INFO() SET_MEMORY_INFO_NAME(ProcessWrap) SET_SELF_SIZE(ProcessWrap) @@ -325,3 +332,5 @@ class ProcessWrap : public HandleWrap { } // namespace node NODE_BINDING_CONTEXT_AWARE_INTERNAL(process_wrap, node::ProcessWrap::Initialize) +NODE_BINDING_EXTERNAL_REFERENCE(process_wrap, + node::ProcessWrap::RegisterExternalReferences)