Skip to content

Commit 84e2f51

Browse files
joyeecheungRafaelGSS
authored andcommitted
src: register spawn_sync external references
PR-URL: #50943 Refs: #50924 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 2cfee53 commit 84e2f51

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/node_external_reference.h

+1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class ExternalReferenceRegistry {
123123
V(string_decoder) \
124124
V(stream_wrap) \
125125
V(signal_wrap) \
126+
V(spawn_sync) \
126127
V(trace_events) \
127128
V(timers) \
128129
V(types) \

src/spawn_sync.cc

+7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "spawn_sync.h"
2323
#include "debug_utils-inl.h"
2424
#include "env-inl.h"
25+
#include "node_external_reference.h"
2526
#include "node_internals.h"
2627
#include "string_bytes.h"
2728
#include "util-inl.h"
@@ -366,6 +367,10 @@ void SyncProcessRunner::Initialize(Local<Object> target,
366367
SetMethod(context, target, "spawn", Spawn);
367368
}
368369

370+
void SyncProcessRunner::RegisterExternalReferences(
371+
ExternalReferenceRegistry* registry) {
372+
registry->Register(Spawn);
373+
}
369374

370375
void SyncProcessRunner::Spawn(const FunctionCallbackInfo<Value>& args) {
371376
Environment* env = Environment::GetCurrent(args);
@@ -1107,3 +1112,5 @@ void SyncProcessRunner::KillTimerCloseCallback(uv_handle_t* handle) {
11071112

11081113
NODE_BINDING_CONTEXT_AWARE_INTERNAL(spawn_sync,
11091114
node::SyncProcessRunner::Initialize)
1115+
NODE_BINDING_EXTERNAL_REFERENCE(
1116+
spawn_sync, node::SyncProcessRunner::RegisterExternalReferences)

src/spawn_sync.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030

3131
namespace node {
3232

33-
34-
33+
class ExternalReferenceRegistry;
3534
class SyncProcessOutputBuffer;
3635
class SyncProcessStdioPipe;
3736
class SyncProcessRunner;
@@ -140,6 +139,7 @@ class SyncProcessRunner {
140139
};
141140

142141
public:
142+
static void RegisterExternalReferences(ExternalReferenceRegistry* registry);
143143
static void Initialize(v8::Local<v8::Object> target,
144144
v8::Local<v8::Value> unused,
145145
v8::Local<v8::Context> context,

0 commit comments

Comments
 (0)