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
- // A list of built-in modules . In order to do module registration
30
- // in node::Init(), need to add built-in modules in the following list.
31
- // Then in binding::RegisterBuiltinModules (), it calls modules ' registration
32
- // function. This helps the built-in modules are loaded properly when
29
+ // A list of built-in bindings . In order to do binding registration
30
+ // in node::Init(), need to add built-in bindings in the following list.
31
+ // Then in binding::RegisterBuiltinBindings (), it calls bindings ' registration
32
+ // function. This helps the built-in bindings are loaded properly when
33
33
// node is built as static library. No need to depend on the
34
34
// __attribute__((constructor)) like mechanism in GCC.
35
- #define NODE_BUILTIN_STANDARD_MODULES (V ) \
35
+ #define NODE_BUILTIN_STANDARD_BINDINGS (V ) \
36
36
V (async_wrap) \
37
37
V(blob) \
38
38
V(block_list) \
86
86
V(worker) \
87
87
V(zlib)
88
88
89
- #define NODE_BUILTIN_MODULES (V ) \
90
- NODE_BUILTIN_STANDARD_MODULES (V) \
91
- NODE_BUILTIN_OPENSSL_MODULES (V) \
92
- NODE_BUILTIN_ICU_MODULES (V) \
93
- NODE_BUILTIN_PROFILER_MODULES (V)
89
+ #define NODE_BUILTIN_BINDINGS (V ) \
90
+ NODE_BUILTIN_STANDARD_BINDINGS (V) \
91
+ NODE_BUILTIN_OPENSSL_BINDINGS (V) \
92
+ NODE_BUILTIN_ICU_BINDINGS (V) \
93
+ NODE_BUILTIN_PROFILER_BINDINGS (V)
94
94
95
- // This is used to load built-in modules . Instead of using
95
+ // This is used to load built-in bindings . Instead of using
96
96
// __attribute__((constructor)), we call the _register_<modname>
97
- // function for each built-in modules explicitly in
98
- // binding::RegisterBuiltinModules (). This is only forward declaration.
99
- // The definitions are in each module 's implementation when calling
100
- // the NODE_MODULE_CONTEXT_AWARE_INTERNAL .
97
+ // function for each built-in bindings explicitly in
98
+ // binding::RegisterBuiltinBindings (). This is only forward declaration.
99
+ // The definitions are in each binding 's implementation when calling
100
+ // the NODE_BINDING_CONTEXT_AWARE_INTERNAL .
101
101
#define V (modname ) void _register_##modname();
102
- NODE_BUILTIN_MODULES (V)
102
+ NODE_BUILTIN_BINDINGS (V)
103
103
#undef V
104
104
105
105
#ifdef _AIX
@@ -552,9 +552,9 @@ inline struct node_module* FindModule(struct node_module* list,
552
552
return mp;
553
553
}
554
554
555
- static Local<Object> InitModule (Environment* env,
556
- node_module* mod,
557
- Local<String> module) {
555
+ static Local<Object> InitInternalBinding (Environment* env,
556
+ node_module* mod,
557
+ Local<String> module) {
558
558
// Internal bindings don't have a "module" object, only exports.
559
559
Local<Function> ctor = env->binding_data_ctor_template ()
560
560
->GetFunction (env->context ())
@@ -578,7 +578,7 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
578
578
579
579
node_module* mod = FindModule (modlist_internal, *module_v, NM_F_INTERNAL);
580
580
if (mod != nullptr ) {
581
- exports = InitModule (env, mod, module);
581
+ exports = InitInternalBinding (env, mod, module);
582
582
env->internal_bindings .insert (mod);
583
583
} else if (!strcmp (*module_v, " constants" )) {
584
584
exports = Object::New (env->isolate ());
@@ -595,7 +595,7 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
595
595
builtins::BuiltinLoader::GetConfigString (env->isolate ()))
596
596
.FromJust ());
597
597
} else {
598
- return THROW_ERR_INVALID_MODULE (env, " No such module : %s" , *module_v);
598
+ return THROW_ERR_INVALID_MODULE (env, " No such binding : %s" , *module_v);
599
599
}
600
600
601
601
args.GetReturnValue ().Set (exports);
@@ -626,7 +626,7 @@ void GetLinkedBinding(const FunctionCallbackInfo<Value>& args) {
626
626
627
627
if (mod == nullptr ) {
628
628
return THROW_ERR_INVALID_MODULE (
629
- env, " No such module was linked: %s" , *module_name_v);
629
+ env, " No such binding was linked: %s" , *module_name_v);
630
630
}
631
631
632
632
Local<Object> module = Object::New (env->isolate ());
@@ -642,8 +642,7 @@ void GetLinkedBinding(const FunctionCallbackInfo<Value>& args) {
642
642
mod->nm_register_func (exports, module, mod->nm_priv );
643
643
} else {
644
644
return THROW_ERR_INVALID_MODULE (
645
- env,
646
- " Linked moduled has no declared entry point." );
645
+ env, " Linked binding has no declared entry point." );
647
646
}
648
647
649
648
auto effective_exports =
@@ -652,11 +651,11 @@ void GetLinkedBinding(const FunctionCallbackInfo<Value>& args) {
652
651
args.GetReturnValue ().Set (effective_exports);
653
652
}
654
653
655
- // Call built-in modules ' _register_<module name> function to
656
- // do module registration explicitly.
657
- void RegisterBuiltinModules () {
654
+ // Call built-in bindings ' _register_<module name> function to
655
+ // do binding registration explicitly.
656
+ void RegisterBuiltinBindings () {
658
657
#define V (modname ) _register_##modname();
659
- NODE_BUILTIN_MODULES (V)
658
+ NODE_BUILTIN_BINDINGS (V)
660
659
#undef V
661
660
}
662
661
@@ -668,5 +667,5 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
668
667
} // namespace binding
669
668
} // namespace node
670
669
671
- NODE_MODULE_EXTERNAL_REFERENCE (binding,
672
- node::binding::RegisterExternalReferences)
670
+ NODE_BINDING_EXTERNAL_REFERENCE (binding,
671
+ node::binding::RegisterExternalReferences)
0 commit comments