Skip to content

Commit a1b0e64

Browse files
joyeecheungdanielleadams
authored andcommitted
src: support fs_event_wrap binding in the snapshot
PR-URL: #38737 Refs: #35711 Reviewed-By: Anna Henningsen <[email protected]>
1 parent 21ce3af commit a1b0e64

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/fs_event_wrap.cc

+11-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121

2222
#include "async_wrap-inl.h"
2323
#include "env-inl.h"
24-
#include "node.h"
2524
#include "handle_wrap.h"
25+
#include "node.h"
26+
#include "node_external_reference.h"
2627
#include "string_bytes.h"
2728

28-
2929
namespace node {
3030

3131
using v8::Context;
@@ -52,6 +52,7 @@ class FSEventWrap: public HandleWrap {
5252
Local<Value> unused,
5353
Local<Context> context,
5454
void* priv);
55+
static void RegisterExternalReferences(ExternalReferenceRegistry* registry);
5556
static void New(const FunctionCallbackInfo<Value>& args);
5657
static void Start(const FunctionCallbackInfo<Value>& args);
5758
static void GetInitialized(const FunctionCallbackInfo<Value>& args);
@@ -117,6 +118,12 @@ void FSEventWrap::Initialize(Local<Object> target,
117118
env->SetConstructorFunction(target, "FSEvent", t);
118119
}
119120

121+
void FSEventWrap::RegisterExternalReferences(
122+
ExternalReferenceRegistry* registry) {
123+
registry->Register(New);
124+
registry->Register(Start);
125+
registry->Register(GetInitialized);
126+
}
120127

121128
void FSEventWrap::New(const FunctionCallbackInfo<Value>& args) {
122129
CHECK(args.IsConstructCall());
@@ -229,3 +236,5 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename,
229236
} // namespace node
230237

231238
NODE_MODULE_CONTEXT_AWARE_INTERNAL(fs_event_wrap, node::FSEventWrap::Initialize)
239+
NODE_MODULE_EXTERNAL_REFERENCE(fs_event_wrap,
240+
node::FSEventWrap::RegisterExternalReferences)

src/node_external_reference.h

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class ExternalReferenceRegistry {
5656
V(errors) \
5757
V(fs) \
5858
V(fs_dir) \
59+
V(fs_event_wrap) \
5960
V(handle_wrap) \
6061
V(heap_utils) \
6162
V(messaging) \

0 commit comments

Comments
 (0)