mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -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) \
|
||||
|
||||
Reference in New Issue
Block a user