src: rename internal module declaration as internal bindings

This is a continuation of the name reification on the internal bindings.

Renames NODE_MODULE_CONTEXT_AWARE_INTERNAL and
NODE_MODULE_EXTERNAL_REFERENCE to NODE_BINDING_CONTEXT_AWARE_INTERNAL
and NODE_BINDING_EXTERNAL_REFERENCE respectively.

PR-URL: https://github.com/nodejs/node/pull/45551
Refs: https://github.com/nodejs/node/issues/44036
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
legendecas 2022-11-21 01:37:56 +08:00
parent d09f0c4dbc
commit 71ff89f929
No known key found for this signature in database
GPG Key ID: CB3C9EC2BC27057C
64 changed files with 188 additions and 184 deletions

View File

@ -419,9 +419,9 @@ void Initialize(Local<Object> target,
SetConstructorFunction(context, target, "ChannelWrap", channel_wrap); SetConstructorFunction(context, target, "ChannelWrap", channel_wrap);
} }
// Run the `Initialize` function when loading this module through // Run the `Initialize` function when loading this binding through
// `internalBinding('cares_wrap')` in Node.js's built-in JavaScript code: // `internalBinding('cares_wrap')` in Node.js's built-in JavaScript code:
NODE_MODULE_CONTEXT_AWARE_INTERNAL(cares_wrap, Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(cares_wrap, Initialize)
``` ```
If the C++ binding is loaded during bootstrap, it needs to be registered If the C++ binding is loaded during bootstrap, it needs to be registered
@ -438,10 +438,10 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace util } // namespace util
} // namespace node } // namespace node
// The first argument passed to `NODE_MODULE_EXTERNAL_REFERENCE`, // The first argument passed to `NODE_BINDING_EXTERNAL_REFERENCE`,
// which is `util` here, needs to be added to the // which is `util` here, needs to be added to the
// `EXTERNAL_REFERENCE_BINDING_LIST_BASE` list in node_external_reference.h // `EXTERNAL_REFERENCE_BINDING_LIST_BASE` list in node_external_reference.h
NODE_MODULE_EXTERNAL_REFERENCE(util, node::util::RegisterExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(util, node::util::RegisterExternalReferences)
``` ```
Otherwise, you might see an error message like this when building the Otherwise, you might see an error message like this when building the

View File

@ -703,6 +703,6 @@ Local<Object> AsyncWrap::GetOwner(Environment* env, Local<Object> obj) {
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(async_wrap, node::AsyncWrap::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(async_wrap, node::AsyncWrap::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(async_wrap, NODE_BINDING_EXTERNAL_REFERENCE(async_wrap,
node::AsyncWrap::RegisterExternalReferences) node::AsyncWrap::RegisterExternalReferences)

View File

@ -1976,6 +1976,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace cares_wrap } // namespace cares_wrap
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(cares_wrap, node::cares_wrap::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(cares_wrap, node::cares_wrap::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(cares_wrap, NODE_BINDING_EXTERNAL_REFERENCE(cares_wrap,
node::cares_wrap::RegisterExternalReferences) node::cares_wrap::RegisterExternalReferences)

View File

@ -2155,6 +2155,6 @@ void TLSWrap::RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace crypto } // namespace crypto
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(tls_wrap, node::crypto::TLSWrap::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(tls_wrap, node::crypto::TLSWrap::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE( NODE_BINDING_EXTERNAL_REFERENCE(
tls_wrap, node::crypto::TLSWrap::RegisterExternalReferences) tls_wrap, node::crypto::TLSWrap::RegisterExternalReferences)

View File

@ -237,6 +237,7 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename,
} // anonymous namespace } // anonymous namespace
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(fs_event_wrap, node::FSEventWrap::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(fs_event_wrap,
NODE_MODULE_EXTERNAL_REFERENCE(fs_event_wrap, node::FSEventWrap::Initialize)
NODE_BINDING_EXTERNAL_REFERENCE(fs_event_wrap,
node::FSEventWrap::RegisterExternalReferences) node::FSEventWrap::RegisterExternalReferences)

View File

@ -181,5 +181,5 @@ void HandleWrap::RegisterExternalReferences(
} // namespace node } // namespace node
NODE_MODULE_EXTERNAL_REFERENCE(handle_wrap, NODE_BINDING_EXTERNAL_REFERENCE(handle_wrap,
node::HandleWrap::RegisterExternalReferences) node::HandleWrap::RegisterExternalReferences)

View File

@ -486,6 +486,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace heap } // namespace heap
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(heap_utils, node::heap::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(heap_utils, node::heap::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(heap_utils, NODE_BINDING_EXTERNAL_REFERENCE(heap_utils,
node::heap::RegisterExternalReferences) node::heap::RegisterExternalReferences)

View File

@ -399,7 +399,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace inspector } // namespace inspector
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(inspector, NODE_BINDING_CONTEXT_AWARE_INTERNAL(inspector, node::inspector::Initialize)
node::inspector::Initialize) NODE_BINDING_EXTERNAL_REFERENCE(inspector,
NODE_MODULE_EXTERNAL_REFERENCE(inspector,
node::inspector::RegisterExternalReferences) node::inspector::RegisterExternalReferences)

View File

@ -524,6 +524,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace profiler } // namespace profiler
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(profiler, node::profiler::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(profiler, node::profiler::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(profiler, NODE_BINDING_EXTERNAL_REFERENCE(profiler,
node::profiler::RegisterExternalReferences) node::profiler::RegisterExternalReferences)

View File

@ -216,4 +216,4 @@ void JSStream::Initialize(Local<Object> target,
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(js_stream, node::JSStream::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(js_stream, node::JSStream::Initialize)

View File

@ -217,4 +217,4 @@ void JSUDPWrap::Initialize(Local<Object> target,
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(js_udp_wrap, node::JSUDPWrap::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(js_udp_wrap, node::JSUDPWrap::Initialize)

View File

@ -814,5 +814,5 @@ void ModuleWrap::Initialize(Local<Object> target,
} // namespace loader } // namespace loader
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(module_wrap, NODE_BINDING_CONTEXT_AWARE_INTERNAL(module_wrap,
node::loader::ModuleWrap::Initialize) node::loader::ModuleWrap::Initialize)

View File

@ -753,8 +753,8 @@ static ExitCode InitializeNodeWithArgsInternal(
// Initialize node_start_time to get relative uptime. // Initialize node_start_time to get relative uptime.
per_process::node_start_time = uv_hrtime(); per_process::node_start_time = uv_hrtime();
// Register built-in modules // Register built-in bindings
binding::RegisterBuiltinModules(); binding::RegisterBuiltinBindings();
// Make inherited handles noninheritable. // Make inherited handles noninheritable.
if (!(flags & ProcessInitializationFlags::kEnableStdioInheritance) && if (!(flags & ProcessInitializationFlags::kEnableStdioInheritance) &&
@ -1254,5 +1254,5 @@ int Stop(Environment* env) {
#if !HAVE_INSPECTOR #if !HAVE_INSPECTOR
void Initialize() {} void Initialize() {}
NODE_MODULE_CONTEXT_AWARE_INTERNAL(inspector, Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(inspector, Initialize)
#endif // !HAVE_INSPECTOR #endif // !HAVE_INSPECTOR

View File

@ -9,30 +9,30 @@
#include <string> #include <string>
#if HAVE_OPENSSL #if HAVE_OPENSSL
#define NODE_BUILTIN_OPENSSL_MODULES(V) V(crypto) V(tls_wrap) #define NODE_BUILTIN_OPENSSL_BINDINGS(V) V(crypto) V(tls_wrap)
#else #else
#define NODE_BUILTIN_OPENSSL_MODULES(V) #define NODE_BUILTIN_OPENSSL_BINDINGS(V)
#endif #endif
#if NODE_HAVE_I18N_SUPPORT #if NODE_HAVE_I18N_SUPPORT
#define NODE_BUILTIN_ICU_MODULES(V) V(icu) #define NODE_BUILTIN_ICU_BINDINGS(V) V(icu)
#else #else
#define NODE_BUILTIN_ICU_MODULES(V) #define NODE_BUILTIN_ICU_BINDINGS(V)
#endif #endif
#if HAVE_INSPECTOR #if HAVE_INSPECTOR
#define NODE_BUILTIN_PROFILER_MODULES(V) V(profiler) #define NODE_BUILTIN_PROFILER_BINDINGS(V) V(profiler)
#else #else
#define NODE_BUILTIN_PROFILER_MODULES(V) #define NODE_BUILTIN_PROFILER_BINDINGS(V)
#endif #endif
// A list of built-in modules. In order to do module registration // A list of built-in bindings. In order to do binding registration
// in node::Init(), need to add built-in modules in the following list. // in node::Init(), need to add built-in bindings in the following list.
// Then in binding::RegisterBuiltinModules(), it calls modules' registration // Then in binding::RegisterBuiltinBindings(), it calls bindings' registration
// function. This helps the built-in modules are loaded properly when // function. This helps the built-in bindings are loaded properly when
// node is built as static library. No need to depend on the // node is built as static library. No need to depend on the
// __attribute__((constructor)) like mechanism in GCC. // __attribute__((constructor)) like mechanism in GCC.
#define NODE_BUILTIN_STANDARD_MODULES(V) \ #define NODE_BUILTIN_STANDARD_BINDINGS(V) \
V(async_wrap) \ V(async_wrap) \
V(blob) \ V(blob) \
V(block_list) \ V(block_list) \
@ -86,20 +86,20 @@
V(worker) \ V(worker) \
V(zlib) V(zlib)
#define NODE_BUILTIN_MODULES(V) \ #define NODE_BUILTIN_BINDINGS(V) \
NODE_BUILTIN_STANDARD_MODULES(V) \ NODE_BUILTIN_STANDARD_BINDINGS(V) \
NODE_BUILTIN_OPENSSL_MODULES(V) \ NODE_BUILTIN_OPENSSL_BINDINGS(V) \
NODE_BUILTIN_ICU_MODULES(V) \ NODE_BUILTIN_ICU_BINDINGS(V) \
NODE_BUILTIN_PROFILER_MODULES(V) NODE_BUILTIN_PROFILER_BINDINGS(V)
// This is used to load built-in modules. Instead of using // This is used to load built-in bindings. Instead of using
// __attribute__((constructor)), we call the _register_<modname> // __attribute__((constructor)), we call the _register_<modname>
// function for each built-in modules explicitly in // function for each built-in bindings explicitly in
// binding::RegisterBuiltinModules(). This is only forward declaration. // binding::RegisterBuiltinBindings(). This is only forward declaration.
// The definitions are in each module's implementation when calling // The definitions are in each binding's implementation when calling
// the NODE_MODULE_CONTEXT_AWARE_INTERNAL. // the NODE_BINDING_CONTEXT_AWARE_INTERNAL.
#define V(modname) void _register_##modname(); #define V(modname) void _register_##modname();
NODE_BUILTIN_MODULES(V) NODE_BUILTIN_BINDINGS(V)
#undef V #undef V
#ifdef _AIX #ifdef _AIX
@ -552,7 +552,7 @@ inline struct node_module* FindModule(struct node_module* list,
return mp; return mp;
} }
static Local<Object> InitModule(Environment* env, static Local<Object> InitInternalBinding(Environment* env,
node_module* mod, node_module* mod,
Local<String> module) { Local<String> module) {
// Internal bindings don't have a "module" object, only exports. // Internal bindings don't have a "module" object, only exports.
@ -578,7 +578,7 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
node_module* mod = FindModule(modlist_internal, *module_v, NM_F_INTERNAL); node_module* mod = FindModule(modlist_internal, *module_v, NM_F_INTERNAL);
if (mod != nullptr) { if (mod != nullptr) {
exports = InitModule(env, mod, module); exports = InitInternalBinding(env, mod, module);
env->internal_bindings.insert(mod); env->internal_bindings.insert(mod);
} else if (!strcmp(*module_v, "constants")) { } else if (!strcmp(*module_v, "constants")) {
exports = Object::New(env->isolate()); exports = Object::New(env->isolate());
@ -595,7 +595,7 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
builtins::BuiltinLoader::GetConfigString(env->isolate())) builtins::BuiltinLoader::GetConfigString(env->isolate()))
.FromJust()); .FromJust());
} else { } else {
return THROW_ERR_INVALID_MODULE(env, "No such module: %s", *module_v); return THROW_ERR_INVALID_MODULE(env, "No such binding: %s", *module_v);
} }
args.GetReturnValue().Set(exports); args.GetReturnValue().Set(exports);
@ -626,7 +626,7 @@ void GetLinkedBinding(const FunctionCallbackInfo<Value>& args) {
if (mod == nullptr) { if (mod == nullptr) {
return THROW_ERR_INVALID_MODULE( return THROW_ERR_INVALID_MODULE(
env, "No such module was linked: %s", *module_name_v); env, "No such binding was linked: %s", *module_name_v);
} }
Local<Object> module = Object::New(env->isolate()); Local<Object> module = Object::New(env->isolate());
@ -642,8 +642,7 @@ void GetLinkedBinding(const FunctionCallbackInfo<Value>& args) {
mod->nm_register_func(exports, module, mod->nm_priv); mod->nm_register_func(exports, module, mod->nm_priv);
} else { } else {
return THROW_ERR_INVALID_MODULE( return THROW_ERR_INVALID_MODULE(
env, env, "Linked binding has no declared entry point.");
"Linked moduled has no declared entry point.");
} }
auto effective_exports = auto effective_exports =
@ -652,11 +651,11 @@ void GetLinkedBinding(const FunctionCallbackInfo<Value>& args) {
args.GetReturnValue().Set(effective_exports); args.GetReturnValue().Set(effective_exports);
} }
// Call built-in modules' _register_<module name> function to // Call built-in bindings' _register_<module name> function to
// do module registration explicitly. // do binding registration explicitly.
void RegisterBuiltinModules() { void RegisterBuiltinBindings() {
#define V(modname) _register_##modname(); #define V(modname) _register_##modname();
NODE_BUILTIN_MODULES(V) NODE_BUILTIN_BINDINGS(V)
#undef V #undef V
} }
@ -668,5 +667,5 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace binding } // namespace binding
} // namespace node } // namespace node
NODE_MODULE_EXTERNAL_REFERENCE(binding, NODE_BINDING_EXTERNAL_REFERENCE(binding,
node::binding::RegisterExternalReferences) node::binding::RegisterExternalReferences)

View File

@ -24,7 +24,7 @@ static_assert(static_cast<int>(NM_F_LINKED) ==
static_cast<int>(node::ModuleFlags::kLinked), static_cast<int>(node::ModuleFlags::kLinked),
"NM_F_LINKED != node::ModuleFlags::kLinked"); "NM_F_LINKED != node::ModuleFlags::kLinked");
#define NODE_MODULE_CONTEXT_AWARE_CPP(modname, regfunc, priv, flags) \ #define NODE_BINDING_CONTEXT_AWARE_CPP(modname, regfunc, priv, flags) \
static node::node_module _module = { \ static node::node_module _module = { \
NODE_MODULE_VERSION, \ NODE_MODULE_VERSION, \
flags, \ flags, \
@ -44,8 +44,8 @@ void napi_module_register_by_symbol(v8::Local<v8::Object> exports,
namespace node { namespace node {
#define NODE_MODULE_CONTEXT_AWARE_INTERNAL(modname, regfunc) \ #define NODE_BINDING_CONTEXT_AWARE_INTERNAL(modname, regfunc) \
NODE_MODULE_CONTEXT_AWARE_CPP(modname, regfunc, nullptr, NM_F_INTERNAL) NODE_BINDING_CONTEXT_AWARE_CPP(modname, regfunc, nullptr, NM_F_INTERNAL)
// Globals per process // Globals per process
// This is set by node::Init() which is used by embedders // This is set by node::Init() which is used by embedders
@ -83,10 +83,10 @@ class DLib {
}; };
// Call _register<module_name> functions for all of // Call _register<module_name> functions for all of
// the built-in modules. Because built-in modules don't // the built-in bindings. Because built-in bindings don't
// use the __attribute__((constructor)). Need to // use the __attribute__((constructor)). Need to
// explicitly call the _register* functions. // explicitly call the _register* functions.
void RegisterBuiltinModules(); void RegisterBuiltinBindings();
void GetInternalBinding(const v8::FunctionCallbackInfo<v8::Value>& args); void GetInternalBinding(const v8::FunctionCallbackInfo<v8::Value>& args);
void GetLinkedBinding(const v8::FunctionCallbackInfo<v8::Value>& args); void GetLinkedBinding(const v8::FunctionCallbackInfo<v8::Value>& args);
void DLOpen(const v8::FunctionCallbackInfo<v8::Value>& args); void DLOpen(const v8::FunctionCallbackInfo<v8::Value>& args);

View File

@ -501,5 +501,5 @@ void Blob::RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(blob, node::Blob::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(blob, node::Blob::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(blob, node::Blob::RegisterExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(blob, node::Blob::RegisterExternalReferences)

View File

@ -1426,5 +1426,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace Buffer } // namespace Buffer
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(buffer, node::Buffer::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(buffer, node::Buffer::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(buffer, node::Buffer::RegisterExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(buffer,
node::Buffer::RegisterExternalReferences)

View File

@ -747,7 +747,7 @@ void BuiltinLoader::RegisterExternalReferences(
} // namespace builtins } // namespace builtins
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(builtins, NODE_BINDING_CONTEXT_AWARE_INTERNAL(builtins,
node::builtins::BuiltinLoader::Initialize) node::builtins::BuiltinLoader::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE( NODE_BINDING_EXTERNAL_REFERENCE(
builtins, node::builtins::BuiltinLoader::RegisterExternalReferences) builtins, node::builtins::BuiltinLoader::RegisterExternalReferences)

View File

@ -80,4 +80,4 @@ static void Initialize(Local<Object> target,
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(config, node::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(config, node::Initialize)

View File

@ -1425,6 +1425,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace contextify } // namespace contextify
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(contextify, node::contextify::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(contextify, node::contextify::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(contextify, NODE_BINDING_EXTERNAL_REFERENCE(contextify,
node::contextify::RegisterExternalReferences) node::contextify::RegisterExternalReferences)

View File

@ -483,6 +483,6 @@ static void Initialize(Local<Object> target,
} // namespace credentials } // namespace credentials
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(credentials, node::credentials::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(credentials, node::credentials::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(credentials, NODE_BINDING_EXTERNAL_REFERENCE(credentials,
node::credentials::RegisterExternalReferences) node::credentials::RegisterExternalReferences)

View File

@ -92,5 +92,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace crypto } // namespace crypto
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(crypto, node::crypto::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(crypto, node::crypto::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(crypto, node::crypto::RegisterExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(crypto,
node::crypto::RegisterExternalReferences)

View File

@ -425,5 +425,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // end namespace node } // end namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(fs_dir, node::fs_dir::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(fs_dir, node::fs_dir::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(fs_dir, node::fs_dir::RegisterExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(fs_dir,
node::fs_dir::RegisterExternalReferences)

View File

@ -462,4 +462,4 @@ void RegisterEnvVarExternalReferences(ExternalReferenceRegistry* registry) {
} }
} // namespace node } // namespace node
NODE_MODULE_EXTERNAL_REFERENCE(env_var, node::RegisterEnvVarExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(env_var, node::RegisterEnvVarExternalReferences)

View File

@ -1180,5 +1180,6 @@ void TriggerUncaughtException(Isolate* isolate, const v8::TryCatch& try_catch) {
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(errors, node::errors::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(errors, node::errors::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(errors, node::errors::RegisterExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(errors,
node::errors::RegisterExternalReferences)

View File

@ -128,14 +128,14 @@ class ExternalReferenceRegistry {
} // namespace node } // namespace node
// Declare all the external reference registration functions here, // Declare all the external reference registration functions here,
// and define them later with #NODE_MODULE_EXTERNAL_REFERENCE(modname, func); // and define them later with #NODE_BINDING_EXTERNAL_REFERENCE(modname, func);
#define V(modname) \ #define V(modname) \
void _register_external_reference_##modname( \ void _register_external_reference_##modname( \
node::ExternalReferenceRegistry* registry); node::ExternalReferenceRegistry* registry);
EXTERNAL_REFERENCE_BINDING_LIST(V) EXTERNAL_REFERENCE_BINDING_LIST(V)
#undef V #undef V
#define NODE_MODULE_EXTERNAL_REFERENCE(modname, func) \ #define NODE_BINDING_EXTERNAL_REFERENCE(modname, func) \
void _register_external_reference_##modname( \ void _register_external_reference_##modname( \
node::ExternalReferenceRegistry* registry) { \ node::ExternalReferenceRegistry* registry) { \
func(registry); \ func(registry); \

View File

@ -2784,5 +2784,5 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // end namespace node } // end namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(fs, node::fs::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(fs, node::fs::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(fs, node::fs::RegisterExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(fs, node::fs::RegisterExternalReferences)

View File

@ -3362,4 +3362,4 @@ void Initialize(Local<Object> target,
} // namespace http2 } // namespace http2
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(http2, node::http2::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(http2, node::http2::Initialize)

View File

@ -1277,4 +1277,4 @@ void InitializeHttpParser(Local<Object> target,
} // anonymous namespace } // anonymous namespace
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(http_parser, node::InitializeHttpParser) NODE_BINDING_CONTEXT_AWARE_INTERNAL(http_parser, node::InitializeHttpParser)

View File

@ -903,7 +903,7 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace i18n } // namespace i18n
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(icu, node::i18n::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(icu, node::i18n::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(icu, node::i18n::RegisterExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(icu, node::i18n::RegisterExternalReferences)
#endif // NODE_HAVE_I18N_SUPPORT #endif // NODE_HAVE_I18N_SUPPORT

View File

@ -1520,6 +1520,6 @@ static void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace worker } // namespace worker
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(messaging, node::worker::InitMessaging) NODE_BINDING_CONTEXT_AWARE_INTERNAL(messaging, node::worker::InitMessaging)
NODE_MODULE_EXTERNAL_REFERENCE(messaging, NODE_BINDING_EXTERNAL_REFERENCE(messaging,
node::worker::RegisterExternalReferences) node::worker::RegisterExternalReferences)

View File

@ -1291,6 +1291,6 @@ std::vector<std::string> ParseNodeOptionsEnvVar(
} }
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(options, node::options_parser::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(options, node::options_parser::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(options, NODE_BINDING_EXTERNAL_REFERENCE(
node::options_parser::RegisterExternalReferences) options, node::options_parser::RegisterExternalReferences)

View File

@ -423,5 +423,5 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace os } // namespace os
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(os, node::os::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(os, node::os::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(os, node::os::RegisterExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(os, node::os::RegisterExternalReferences)

View File

@ -387,6 +387,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace performance } // namespace performance
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(performance, node::performance::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(performance, node::performance::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(performance, NODE_BINDING_EXTERNAL_REFERENCE(performance,
node::performance::RegisterExternalReferences) node::performance::RegisterExternalReferences)

View File

@ -629,6 +629,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace process } // namespace process
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(process_methods, node::process::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(process_methods, node::process::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(process_methods, NODE_BINDING_EXTERNAL_REFERENCE(process_methods,
node::process::RegisterExternalReferences) node::process::RegisterExternalReferences)

View File

@ -229,5 +229,5 @@ void RegisterProcessExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace node } // namespace node
NODE_MODULE_EXTERNAL_REFERENCE(process_object, NODE_BINDING_EXTERNAL_REFERENCE(process_object,
node::RegisterProcessExternalReferences) node::RegisterProcessExternalReferences)

View File

@ -217,5 +217,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace report } // namespace report
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(report, node::report::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(report, node::report::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(report, node::report::RegisterExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(report,
node::report::RegisterExternalReferences)

View File

@ -540,5 +540,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace serdes } // namespace serdes
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(serdes, node::serdes::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(serdes, node::serdes::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(serdes, node::serdes::RegisterExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(serdes,
node::serdes::RegisterExternalReferences)

View File

@ -1503,6 +1503,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace mksnapshot } // namespace mksnapshot
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(mksnapshot, node::mksnapshot::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(mksnapshot, node::mksnapshot::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(mksnapshot, NODE_BINDING_EXTERNAL_REFERENCE(mksnapshot,
node::mksnapshot::RegisterExternalReferences) node::mksnapshot::RegisterExternalReferences)

View File

@ -886,6 +886,5 @@ BaseObjectPtr<BaseObject> SocketAddressBase::TransferData::Deserialize(
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL( NODE_BINDING_CONTEXT_AWARE_INTERNAL(
block_list, block_list, node::SocketAddressBlockListWrap::Initialize)
node::SocketAddressBlockListWrap::Initialize)

View File

@ -29,4 +29,4 @@ static void Initialize(Local<Object> target,
} // namespace symbols } // namespace symbols
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(symbols, node::symbols::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(symbols, node::symbols::Initialize)

View File

@ -226,6 +226,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace task_queue } // namespace task_queue
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(task_queue, node::task_queue::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(task_queue, node::task_queue::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(task_queue, NODE_BINDING_EXTERNAL_REFERENCE(task_queue,
node::task_queue::RegisterExternalReferences) node::task_queue::RegisterExternalReferences)

View File

@ -168,7 +168,7 @@ void NodeCategorySet::RegisterExternalReferences(
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(trace_events, NODE_BINDING_CONTEXT_AWARE_INTERNAL(trace_events,
node::NodeCategorySet::Initialize) node::NodeCategorySet::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE( NODE_BINDING_EXTERNAL_REFERENCE(
trace_events, node::NodeCategorySet::RegisterExternalReferences) trace_events, node::NodeCategorySet::RegisterExternalReferences)

View File

@ -85,5 +85,5 @@ void RegisterTypesExternalReferences(ExternalReferenceRegistry* registry) {
} }
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(types, node::InitializeTypes) NODE_BINDING_CONTEXT_AWARE_INTERNAL(types, node::InitializeTypes)
NODE_MODULE_EXTERNAL_REFERENCE(types, node::RegisterTypesExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(types, node::RegisterTypesExternalReferences)

View File

@ -1943,5 +1943,5 @@ MaybeLocal<Value> URL::ToObject(Environment* env) const {
} // namespace url } // namespace url
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(url, node::url::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(url, node::url::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(url, node::url::RegisterExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(url, node::url::RegisterExternalReferences)

View File

@ -476,5 +476,5 @@ void Initialize(Local<Object> target,
} // namespace util } // namespace util
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(util, node::util::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(util, node::util::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(util, node::util::RegisterExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(util, node::util::RegisterExternalReferences)

View File

@ -286,5 +286,5 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace v8_utils } // namespace v8_utils
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(v8, node::v8_utils::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(v8, node::v8_utils::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(v8, node::v8_utils::RegisterExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(v8, node::v8_utils::RegisterExternalReferences)

View File

@ -1733,4 +1733,4 @@ static void Initialize(Local<Object> target,
} // namespace wasi } // namespace wasi
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(wasi, node::wasi::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(wasi, node::wasi::Initialize)

View File

@ -208,6 +208,7 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace wasm_web_api } // namespace wasm_web_api
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(wasm_web_api, node::wasm_web_api::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(wasm_web_api,
NODE_MODULE_EXTERNAL_REFERENCE(wasm_web_api, node::wasm_web_api::Initialize)
NODE_BINDING_EXTERNAL_REFERENCE(wasm_web_api,
node::wasm_web_api::RegisterExternalReferences) node::wasm_web_api::RegisterExternalReferences)

View File

@ -435,4 +435,4 @@ static void Initialize(Local<Object> target,
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(watchdog, node::watchdog::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(watchdog, node::watchdog::Initialize)

View File

@ -975,5 +975,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace worker } // namespace worker
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(worker, node::worker::InitWorker) NODE_BINDING_CONTEXT_AWARE_INTERNAL(worker, node::worker::InitWorker)
NODE_MODULE_EXTERNAL_REFERENCE(worker, node::worker::RegisterExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(worker,
node::worker::RegisterExternalReferences)

View File

@ -1430,5 +1430,5 @@ void DefineZlibConstants(Local<Object> target) {
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(zlib, node::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(zlib, node::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(zlib, node::RegisterExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(zlib, node::RegisterExternalReferences)

View File

@ -255,6 +255,6 @@ void PipeWrap::Connect(const FunctionCallbackInfo<Value>& args) {
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(pipe_wrap, node::PipeWrap::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(pipe_wrap, node::PipeWrap::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(pipe_wrap, NODE_BINDING_EXTERNAL_REFERENCE(pipe_wrap,
node::PipeWrap::RegisterExternalReferences) node::PipeWrap::RegisterExternalReferences)

View File

@ -320,4 +320,4 @@ class ProcessWrap : public HandleWrap {
} // anonymous namespace } // anonymous namespace
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(process_wrap, node::ProcessWrap::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(process_wrap, node::ProcessWrap::Initialize)

View File

@ -174,7 +174,6 @@ bool HasSignalJSHandler(int signum) {
} }
} // namespace node } // namespace node
NODE_BINDING_CONTEXT_AWARE_INTERNAL(signal_wrap, node::SignalWrap::Initialize)
NODE_MODULE_CONTEXT_AWARE_INTERNAL(signal_wrap, node::SignalWrap::Initialize) NODE_BINDING_EXTERNAL_REFERENCE(signal_wrap,
NODE_MODULE_EXTERNAL_REFERENCE(signal_wrap,
node::SignalWrap::RegisterExternalReferences) node::SignalWrap::RegisterExternalReferences)

View File

@ -1104,5 +1104,5 @@ void SyncProcessRunner::KillTimerCloseCallback(uv_handle_t* handle) {
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(spawn_sync, NODE_BINDING_CONTEXT_AWARE_INTERNAL(spawn_sync,
node::SyncProcessRunner::Initialize) node::SyncProcessRunner::Initialize)

View File

@ -332,5 +332,4 @@ void InitializeStreamPipe(Local<Object> target,
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(stream_pipe, NODE_BINDING_CONTEXT_AWARE_INTERNAL(stream_pipe, node::InitializeStreamPipe)
node::InitializeStreamPipe)

View File

@ -415,7 +415,7 @@ void LibuvStreamWrap::AfterUvWrite(uv_write_t* req, int status) {
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(stream_wrap, NODE_BINDING_CONTEXT_AWARE_INTERNAL(stream_wrap,
node::LibuvStreamWrap::Initialize) node::LibuvStreamWrap::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE( NODE_BINDING_EXTERNAL_REFERENCE(
stream_wrap, node::LibuvStreamWrap::RegisterExternalReferences) stream_wrap, node::LibuvStreamWrap::RegisterExternalReferences)

View File

@ -342,7 +342,7 @@ void RegisterStringDecoderExternalReferences(
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(string_decoder, NODE_BINDING_CONTEXT_AWARE_INTERNAL(string_decoder,
node::InitializeStringDecoder) node::InitializeStringDecoder)
NODE_MODULE_EXTERNAL_REFERENCE(string_decoder, NODE_BINDING_EXTERNAL_REFERENCE(string_decoder,
node::RegisterStringDecoderExternalReferences) node::RegisterStringDecoderExternalReferences)

View File

@ -450,6 +450,6 @@ MaybeLocal<Object> AddressToJS(Environment* env,
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(tcp_wrap, node::TCPWrap::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(tcp_wrap, node::TCPWrap::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(tcp_wrap, NODE_BINDING_EXTERNAL_REFERENCE(tcp_wrap,
node::TCPWrap::RegisterExternalReferences) node::TCPWrap::RegisterExternalReferences)

View File

@ -71,5 +71,5 @@ void RegisterTimerExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(timers, node::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(timers, node::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(timers, node::RegisterTimerExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(timers, node::RegisterTimerExternalReferences)

View File

@ -156,6 +156,6 @@ TTYWrap::TTYWrap(Environment* env,
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(tty_wrap, node::TTYWrap::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(tty_wrap, node::TTYWrap::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(tty_wrap, NODE_BINDING_EXTERNAL_REFERENCE(tty_wrap,
node::TTYWrap::RegisterExternalReferences) node::TTYWrap::RegisterExternalReferences)

View File

@ -806,4 +806,4 @@ void UDPWrap::GetSendQueueCount(const FunctionCallbackInfo<Value>& args) {
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(udp_wrap, node::UDPWrap::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(udp_wrap, node::UDPWrap::Initialize)

View File

@ -137,5 +137,5 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
} // namespace uv } // namespace uv
} // namespace node } // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(uv, node::uv::Initialize) NODE_BINDING_CONTEXT_AWARE_INTERNAL(uv, node::uv::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(uv, node::uv::RegisterExternalReferences) NODE_BINDING_EXTERNAL_REFERENCE(uv, node::uv::RegisterExternalReferences)