9
9
#include < string>
10
10
11
11
#if HAVE_OPENSSL
12
- #define NODE_BUILTIN_OPENSSL_MODULES (V ) V(crypto) V(tls_wrap)
12
+ #define NODE_BUILTIN_OPENSSL_BINDINGS (V ) V(crypto) V(tls_wrap)
13
13
#else
14
- #define NODE_BUILTIN_OPENSSL_MODULES (V )
14
+ #define NODE_BUILTIN_OPENSSL_BINDINGS (V )
15
15
#endif
16
16
17
17
#if NODE_HAVE_I18N_SUPPORT
18
- #define NODE_BUILTIN_ICU_MODULES (V ) V(icu)
18
+ #define NODE_BUILTIN_ICU_BINDINGS (V ) V(icu)
19
19
#else
20
- #define NODE_BUILTIN_ICU_MODULES (V )
20
+ #define NODE_BUILTIN_ICU_BINDINGS (V )
21
21
#endif
22
22
23
23
#if HAVE_INSPECTOR
24
- #define NODE_BUILTIN_PROFILER_MODULES (V ) V(profiler)
24
+ #define NODE_BUILTIN_PROFILER_BINDINGS (V ) V(profiler)
25
25
#else
26
- #define NODE_BUILTIN_PROFILER_MODULES (V )
26
+ #define NODE_BUILTIN_PROFILER_BINDINGS (V )
27
27
#endif
28
28
29
29
#if HAVE_DTRACE || HAVE_ETW
30
- #define NODE_BUILTIN_DTRACE_MODULES (V ) V(dtrace)
30
+ #define NODE_BUILTIN_DTRACE_BINDINGS (V ) V(dtrace)
31
31
#else
32
- #define NODE_BUILTIN_DTRACE_MODULES (V )
32
+ #define NODE_BUILTIN_DTRACE_BINDINGS (V )
33
33
#endif
34
34
35
- // A list of built-in modules . In order to do module registration
36
- // in node::Init(), need to add built-in modules in the following list.
37
- // Then in binding::RegisterBuiltinModules (), it calls modules ' registration
38
- // function. This helps the built-in modules are loaded properly when
35
+ // A list of built-in bindings . In order to do binding registration
36
+ // in node::Init(), need to add built-in bindings in the following list.
37
+ // Then in binding::RegisterBuiltinBindings (), it calls bindings ' registration
38
+ // function. This helps the built-in bindings are loaded properly when
39
39
// node is built as static library. No need to depend on the
40
40
// __attribute__((constructor)) like mechanism in GCC.
41
- #define NODE_BUILTIN_STANDARD_MODULES (V ) \
41
+ #define NODE_BUILTIN_STANDARD_BINDINGS (V ) \
42
42
V (async_wrap) \
43
43
V(blob) \
44
44
V(block_list) \
92
92
V(worker) \
93
93
V(zlib)
94
94
95
- #define NODE_BUILTIN_MODULES (V ) \
96
- NODE_BUILTIN_STANDARD_MODULES (V) \
97
- NODE_BUILTIN_OPENSSL_MODULES (V) \
98
- NODE_BUILTIN_ICU_MODULES (V) \
99
- NODE_BUILTIN_PROFILER_MODULES (V) \
100
- NODE_BUILTIN_DTRACE_MODULES (V)
95
+ #define NODE_BUILTIN_BINDINGS (V ) \
96
+ NODE_BUILTIN_STANDARD_BINDINGS (V) \
97
+ NODE_BUILTIN_OPENSSL_BINDINGS (V) \
98
+ NODE_BUILTIN_ICU_BINDINGS (V) \
99
+ NODE_BUILTIN_PROFILER_BINDINGS (V) \
100
+ NODE_BUILTIN_DTRACE_BINDINGS (V)
101
101
102
- // This is used to load built-in modules . Instead of using
102
+ // This is used to load built-in bindings . Instead of using
103
103
// __attribute__((constructor)), we call the _register_<modname>
104
- // function for each built-in modules explicitly in
105
- // binding::RegisterBuiltinModules (). This is only forward declaration.
106
- // The definitions are in each module 's implementation when calling
107
- // the NODE_MODULE_CONTEXT_AWARE_INTERNAL .
104
+ // function for each built-in bindings explicitly in
105
+ // binding::RegisterBuiltinBindings (). This is only forward declaration.
106
+ // The definitions are in each binding 's implementation when calling
107
+ // the NODE_BINDING_CONTEXT_AWARE_INTERNAL .
108
108
#define V (modname ) void _register_##modname();
109
- NODE_BUILTIN_MODULES (V)
109
+ NODE_BUILTIN_BINDINGS (V)
110
110
#undef V
111
111
112
112
#ifdef _AIX
@@ -559,9 +559,9 @@ inline struct node_module* FindModule(struct node_module* list,
559
559
return mp;
560
560
}
561
561
562
- static Local<Object> InitModule (Environment* env,
563
- node_module* mod,
564
- Local<String> module) {
562
+ static Local<Object> InitInternalBinding (Environment* env,
563
+ node_module* mod,
564
+ Local<String> module) {
565
565
// Internal bindings don't have a "module" object, only exports.
566
566
Local<Function> ctor = env->binding_data_ctor_template ()
567
567
->GetFunction (env->context ())
@@ -585,7 +585,7 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
585
585
586
586
node_module* mod = FindModule (modlist_internal, *module_v, NM_F_INTERNAL);
587
587
if (mod != nullptr ) {
588
- exports = InitModule (env, mod, module);
588
+ exports = InitInternalBinding (env, mod, module);
589
589
env->internal_bindings .insert (mod);
590
590
} else if (!strcmp (*module_v, " constants" )) {
591
591
exports = Object::New (env->isolate ());
@@ -602,7 +602,7 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
602
602
builtins::BuiltinLoader::GetConfigString (env->isolate ()))
603
603
.FromJust ());
604
604
} else {
605
- return THROW_ERR_INVALID_MODULE (env, " No such module : %s" , *module_v);
605
+ return THROW_ERR_INVALID_MODULE (env, " No such binding : %s" , *module_v);
606
606
}
607
607
608
608
args.GetReturnValue ().Set (exports);
@@ -633,7 +633,7 @@ void GetLinkedBinding(const FunctionCallbackInfo<Value>& args) {
633
633
634
634
if (mod == nullptr ) {
635
635
return THROW_ERR_INVALID_MODULE (
636
- env, " No such module was linked: %s" , *module_name_v);
636
+ env, " No such binding was linked: %s" , *module_name_v);
637
637
}
638
638
639
639
Local<Object> module = Object::New (env->isolate ());
@@ -649,8 +649,7 @@ void GetLinkedBinding(const FunctionCallbackInfo<Value>& args) {
649
649
mod->nm_register_func (exports, module, mod->nm_priv );
650
650
} else {
651
651
return THROW_ERR_INVALID_MODULE (
652
- env,
653
- " Linked moduled has no declared entry point." );
652
+ env, " Linked binding has no declared entry point." );
654
653
}
655
654
656
655
auto effective_exports =
@@ -659,11 +658,11 @@ void GetLinkedBinding(const FunctionCallbackInfo<Value>& args) {
659
658
args.GetReturnValue ().Set (effective_exports);
660
659
}
661
660
662
- // Call built-in modules ' _register_<module name> function to
663
- // do module registration explicitly.
664
- void RegisterBuiltinModules () {
661
+ // Call built-in bindings ' _register_<module name> function to
662
+ // do binding registration explicitly.
663
+ void RegisterBuiltinBindings () {
665
664
#define V (modname ) _register_##modname();
666
- NODE_BUILTIN_MODULES (V)
665
+ NODE_BUILTIN_BINDINGS (V)
667
666
#undef V
668
667
}
669
668
@@ -675,5 +674,5 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
675
674
} // namespace binding
676
675
} // namespace node
677
676
678
- NODE_MODULE_EXTERNAL_REFERENCE (binding,
679
- node::binding::RegisterExternalReferences)
677
+ NODE_BINDING_EXTERNAL_REFERENCE (binding,
678
+ node::binding::RegisterExternalReferences)
0 commit comments