From 2cfee53d7b5016c4c39a96cd5c952d14f50bfa9a 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 f15c97c03d2e9d..e516bf6471d4af 100644 --- a/src/node_external_reference.h +++ b/src/node_external_reference.h @@ -110,6 +110,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)