src: support fs_event_wrap binding in the snapshot

PR-URL: https://github.com/nodejs/node/pull/38737
Refs: https://github.com/nodejs/node/issues/35711
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Joyee Cheung authored and Danielle Adams committed 2021-05-31 15:34:56 -04:00
1 parent 21ce3af904
commit a1b0e64187
2 files changed
+12 -2

No files matched your search

+11 -2
View File
@@ -21,11 +21,11 @@
#include "async_wrap-inl.h"
#include "env-inl.h"
#include "node.h"
#include "handle_wrap.h"
#include "node.h"
#include "node_external_reference.h"
#include "string_bytes.h"
namespace node {
using v8::Context;
@@ -52,6 +52,7 @@ class FSEventWrap: public HandleWrap {
Local<Value> unused,
Local<Context> context,
void* priv);
static void RegisterExternalReferences(ExternalReferenceRegistry* registry);
static void New(const FunctionCallbackInfo<Value>& args);
static void Start(const FunctionCallbackInfo<Value>& args);
static void GetInitialized(const FunctionCallbackInfo<Value>& args);
@@ -117,6 +118,12 @@ void FSEventWrap::Initialize(Local<Object> target,
env->SetConstructorFunction(target, "FSEvent", t);
}
void FSEventWrap::RegisterExternalReferences(
ExternalReferenceRegistry* registry) {
registry->Register(New);
registry->Register(Start);
registry->Register(GetInitialized);
}
void FSEventWrap::New(const FunctionCallbackInfo<Value>& args) {
CHECK(args.IsConstructCall());
@@ -229,3 +236,5 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename,
} // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(fs_event_wrap, node::FSEventWrap::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(fs_event_wrap,
node::FSEventWrap::RegisterExternalReferences)
+1
View File
@@ -56,6 +56,7 @@ class ExternalReferenceRegistry {
V(errors) \
V(fs) \
V(fs_dir) \
V(fs_event_wrap) \
V(handle_wrap) \
V(heap_utils) \
V(messaging) \