From 6095fb07b6f8ffd46cc4ae34d6d423bd5606e817 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Tue, 31 Aug 2021 23:20:04 +0800 Subject: [PATCH] src: register external references of SignalWrap for snapshot PR-URL: https://github.com/nodejs/node/pull/39961 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Michael Dawson --- src/node_external_reference.h | 1 + src/signal_wrap.cc | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/node_external_reference.h b/src/node_external_reference.h index 37f06e9d30b577..516a661b61c152 100644 --- a/src/node_external_reference.h +++ b/src/node_external_reference.h @@ -72,6 +72,7 @@ class ExternalReferenceRegistry { V(serdes) \ V(string_decoder) \ V(stream_wrap) \ + V(signal_wrap) \ V(trace_events) \ V(timers) \ V(types) \ diff --git a/src/signal_wrap.cc b/src/signal_wrap.cc index e8a1500d2e9961..df7f94eeec8451 100644 --- a/src/signal_wrap.cc +++ b/src/signal_wrap.cc @@ -22,6 +22,7 @@ #include "async_wrap-inl.h" #include "env-inl.h" #include "handle_wrap.h" +#include "node_external_reference.h" #include "node_process-inl.h" #include "util-inl.h" #include "v8.h" @@ -62,6 +63,12 @@ class SignalWrap : public HandleWrap { env->SetConstructorFunction(target, "Signal", constructor); } + static void RegisterExternalReferences(ExternalReferenceRegistry* registry) { + registry->Register(New); + registry->Register(Start); + registry->Register(Stop); + } + SET_NO_MEMORY_INFO() SET_MEMORY_INFO_NAME(SignalWrap) SET_SELF_SIZE(SignalWrap) @@ -167,3 +174,5 @@ bool HasSignalJSHandler(int signum) { NODE_MODULE_CONTEXT_AWARE_INTERNAL(signal_wrap, node::SignalWrap::Initialize) +NODE_MODULE_EXTERNAL_REFERENCE(signal_wrap, + node::SignalWrap::RegisterExternalReferences)