Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2021-05-19 20:49:32 +0300
committerJoyee Cheung <joyeec9h3@gmail.com>2021-05-27 16:46:44 +0300
commit39b0f4fe4c4e663be5529228dcd41d5133468eed (patch)
tree8d21b0166edaa7b317a71153c032f408359fe8b6 /src/fs_event_wrap.cc
parentb6471c9e7623bf211873ae4bc024ab0f5558e08f (diff)
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>
Diffstat (limited to 'src/fs_event_wrap.cc')
-rw-r--r--src/fs_event_wrap.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc
index b79da7e8362..f13d22535c1 100644
--- a/src/fs_event_wrap.cc
+++ b/src/fs_event_wrap.cc
@@ -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)