From 6c466811d352bfe7f2b414a31c2e8c25f99cbfd6 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Fri, 23 Mar 2018 09:38:16 +0100 Subject: [PATCH] src: name all builtin init functions Initialize This commit renames a few of the builtin modules init functions to Initialize for consistency. PR-URL: https://github.com/nodejs/node/pull/19550 Reviewed-By: Anna Henningsen Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: James M Snell --- src/inspector_js_api.cc | 6 +++--- src/node.cc | 4 ++-- src/node_config.cc | 4 ++-- src/node_contextify.cc | 8 ++++---- src/node_crypto.cc | 4 ++-- src/node_http_parser.cc | 10 +++++----- src/node_i18n.cc | 10 +++++----- src/node_perf.cc | 8 ++++---- src/node_serdes.cc | 8 ++++---- src/node_trace_events.cc | 10 +++++----- src/node_url.cc | 10 +++++----- src/node_v8.cc | 8 ++++---- src/node_zlib.cc | 10 +++++----- src/uv.cc | 8 ++++---- 14 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/inspector_js_api.cc b/src/inspector_js_api.cc index e727410202b119..35d17413762364 100644 --- a/src/inspector_js_api.cc +++ b/src/inspector_js_api.cc @@ -298,8 +298,8 @@ void Url(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(OneByteString(env->isolate(), url.c_str())); } -void InitInspectorBindings(Local target, Local unused, - Local context, void* priv) { +void Initialize(Local target, Local unused, + Local context, void* priv) { Environment* env = Environment::GetCurrent(context); { auto obj = Object::New(env->isolate()); @@ -343,4 +343,4 @@ void InitInspectorBindings(Local target, Local unused, } // namespace node NODE_BUILTIN_MODULE_CONTEXT_AWARE(inspector, - node::inspector::InitInspectorBindings); + node::inspector::Initialize); diff --git a/src/node.cc b/src/node.cc index a180f97cd4140e..e87dfe614a3cd3 100644 --- a/src/node.cc +++ b/src/node.cc @@ -4910,7 +4910,7 @@ void RegisterBuiltinModules() { } // namespace node #if !HAVE_INSPECTOR -void InitEmptyBindings() {} +void Initialize() {} -NODE_BUILTIN_MODULE_CONTEXT_AWARE(inspector, InitEmptyBindings) +NODE_BUILTIN_MODULE_CONTEXT_AWARE(inspector, Initialize) #endif // !HAVE_INSPECTOR diff --git a/src/node_config.cc b/src/node_config.cc index cac551ad2c410a..0542bff1d65186 100644 --- a/src/node_config.cc +++ b/src/node_config.cc @@ -36,7 +36,7 @@ using v8::Value; value, ReadOnly).FromJust(); \ } while (0) -static void InitConfig(Local target, +static void Initialize(Local target, Local unused, Local context) { Environment* env = Environment::GetCurrent(context); @@ -138,4 +138,4 @@ static void InitConfig(Local target, } // namespace node -NODE_BUILTIN_MODULE_CONTEXT_AWARE(config, node::InitConfig) +NODE_BUILTIN_MODULE_CONTEXT_AWARE(config, node::Initialize) diff --git a/src/node_contextify.cc b/src/node_contextify.cc index e7f956e9882689..33134825b11fc9 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -1155,9 +1155,9 @@ class ContextifyScript : public BaseObject { }; -void InitContextify(Local target, - Local unused, - Local context) { +void Initialize(Local target, + Local unused, + Local context) { Environment* env = Environment::GetCurrent(context); ContextifyContext::Init(env, target); ContextifyScript::Init(env, target); @@ -1166,4 +1166,4 @@ void InitContextify(Local target, } // namespace contextify } // namespace node -NODE_BUILTIN_MODULE_CONTEXT_AWARE(contextify, node::contextify::InitContextify) +NODE_BUILTIN_MODULE_CONTEXT_AWARE(contextify, node::contextify::Initialize) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 89e2fdc6d6ab0b..40548cf230367f 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -6268,7 +6268,7 @@ void SetFipsCrypto(const FunctionCallbackInfo& args) { } #endif /* NODE_FIPS_MODE */ -void InitCrypto(Local target, +void Initialize(Local target, Local unused, Local context, void* priv) { @@ -6341,4 +6341,4 @@ void InitCrypto(Local target, } // namespace crypto } // namespace node -NODE_BUILTIN_MODULE_CONTEXT_AWARE(crypto, node::crypto::InitCrypto) +NODE_BUILTIN_MODULE_CONTEXT_AWARE(crypto, node::crypto::Initialize) diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc index 207310f4068f43..19a4a6fba487c1 100644 --- a/src/node_http_parser.cc +++ b/src/node_http_parser.cc @@ -711,10 +711,10 @@ const struct http_parser_settings Parser::settings = { }; -void InitHttpParser(Local target, - Local unused, - Local context, - void* priv) { +void Initialize(Local target, + Local unused, + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); Local t = env->NewFunctionTemplate(Parser::New); t->InstanceTemplate()->SetInternalFieldCount(1); @@ -761,4 +761,4 @@ void InitHttpParser(Local target, } // anonymous namespace } // namespace node -NODE_BUILTIN_MODULE_CONTEXT_AWARE(http_parser, node::InitHttpParser) +NODE_BUILTIN_MODULE_CONTEXT_AWARE(http_parser, node::Initialize) diff --git a/src/node_i18n.cc b/src/node_i18n.cc index d65fc55ed1fee5..7f462d5aead087 100644 --- a/src/node_i18n.cc +++ b/src/node_i18n.cc @@ -852,10 +852,10 @@ static void GetStringWidth(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(width); } -void Init(Local target, - Local unused, - Local context, - void* priv) { +void Initialize(Local target, + Local unused, + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); env->SetMethod(target, "toUnicode", ToUnicode); env->SetMethod(target, "toASCII", ToASCII); @@ -875,6 +875,6 @@ void Init(Local target, } // namespace i18n } // namespace node -NODE_BUILTIN_MODULE_CONTEXT_AWARE(icu, node::i18n::Init) +NODE_BUILTIN_MODULE_CONTEXT_AWARE(icu, node::i18n::Initialize) #endif // NODE_HAVE_I18N_SUPPORT diff --git a/src/node_perf.cc b/src/node_perf.cc index 1f7f127a837527..f5e2d395c48f58 100644 --- a/src/node_perf.cc +++ b/src/node_perf.cc @@ -347,9 +347,9 @@ void Timerify(const FunctionCallbackInfo& args) { } -void Init(Local target, - Local unused, - Local context) { +void Initialize(Local target, + Local unused, + Local context) { Environment* env = Environment::GetCurrent(context); Isolate* isolate = env->isolate(); performance_state* state = env->performance_state(); @@ -418,4 +418,4 @@ void Init(Local target, } // namespace performance } // namespace node -NODE_BUILTIN_MODULE_CONTEXT_AWARE(performance, node::performance::Init) +NODE_BUILTIN_MODULE_CONTEXT_AWARE(performance, node::performance::Initialize) diff --git a/src/node_serdes.cc b/src/node_serdes.cc index 5eb4455a0eb807..1995eb1b9b506b 100644 --- a/src/node_serdes.cc +++ b/src/node_serdes.cc @@ -424,9 +424,9 @@ void DeserializerContext::ReadRawBytes( args.GetReturnValue().Set(offset); } -void InitializeSerdesBindings(Local target, - Local unused, - Local context) { +void Initialize(Local target, + Local unused, + Local context) { Environment* env = Environment::GetCurrent(context); Local ser = env->NewFunctionTemplate(SerializerContext::New); @@ -483,4 +483,4 @@ void InitializeSerdesBindings(Local target, } // anonymous namespace } // namespace node -NODE_BUILTIN_MODULE_CONTEXT_AWARE(serdes, node::InitializeSerdesBindings) +NODE_BUILTIN_MODULE_CONTEXT_AWARE(serdes, node::Initialize) diff --git a/src/node_trace_events.cc b/src/node_trace_events.cc index f269b32fbef869..96d00115feee74 100644 --- a/src/node_trace_events.cc +++ b/src/node_trace_events.cc @@ -132,10 +132,10 @@ static void CategoryGroupEnabled(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(*category_group_enabled > 0); } -void InitializeTraceEvents(Local target, - Local unused, - Local context, - void* priv) { +void Initialize(Local target, + Local unused, + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); env->SetMethod(target, "emit", Emit); @@ -144,4 +144,4 @@ void InitializeTraceEvents(Local target, } // namespace node -NODE_BUILTIN_MODULE_CONTEXT_AWARE(trace_events, node::InitializeTraceEvents) +NODE_BUILTIN_MODULE_CONTEXT_AWARE(trace_events, node::Initialize) diff --git a/src/node_url.cc b/src/node_url.cc index cac2831af6ef7f..af72ebc5547cf0 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -2290,10 +2290,10 @@ static void SetURLConstructor(const FunctionCallbackInfo& args) { env->set_url_constructor_function(args[0].As()); } -static void Init(Local target, - Local unused, - Local context, - void* priv) { +static void Initialize(Local target, + Local unused, + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); env->SetMethod(target, "parse", Parse); env->SetMethod(target, "encodeAuth", EncodeAuthSet); @@ -2313,4 +2313,4 @@ static void Init(Local target, } // namespace url } // namespace node -NODE_BUILTIN_MODULE_CONTEXT_AWARE(url, node::url::Init) +NODE_BUILTIN_MODULE_CONTEXT_AWARE(url, node::url::Initialize) diff --git a/src/node_v8.cc b/src/node_v8.cc index d1514cb0973dbe..bb41b569e6f796 100644 --- a/src/node_v8.cc +++ b/src/node_v8.cc @@ -119,9 +119,9 @@ void SetFlagsFromString(const FunctionCallbackInfo& args) { } -void InitializeV8Bindings(Local target, - Local unused, - Local context) { +void Initialize(Local target, + Local unused, + Local context) { Environment* env = Environment::GetCurrent(context); env->SetMethod(target, "cachedDataVersionTag", CachedDataVersionTag); @@ -201,4 +201,4 @@ void InitializeV8Bindings(Local target, } // namespace node -NODE_BUILTIN_MODULE_CONTEXT_AWARE(v8, node::InitializeV8Bindings) +NODE_BUILTIN_MODULE_CONTEXT_AWARE(v8, node::Initialize) diff --git a/src/node_zlib.cc b/src/node_zlib.cc index 388630d507a433..500a62a52bf6c4 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -681,10 +681,10 @@ class ZCtx : public AsyncWrap { }; -void InitZlib(Local target, - Local unused, - Local context, - void* priv) { +void Initialize(Local target, + Local unused, + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); Local z = env->NewFunctionTemplate(ZCtx::New); @@ -709,4 +709,4 @@ void InitZlib(Local target, } // anonymous namespace } // namespace node -NODE_BUILTIN_MODULE_CONTEXT_AWARE(zlib, node::InitZlib) +NODE_BUILTIN_MODULE_CONTEXT_AWARE(zlib, node::Initialize) diff --git a/src/uv.cc b/src/uv.cc index 1ffd093c6ba4aa..85cb2ad5373c5f 100644 --- a/src/uv.cc +++ b/src/uv.cc @@ -50,9 +50,9 @@ void ErrName(const FunctionCallbackInfo& args) { } -void InitializeUV(Local target, - Local unused, - Local context) { +void Initialize(Local target, + Local unused, + Local context) { Environment* env = Environment::GetCurrent(context); Isolate* isolate = env->isolate(); target->Set(FIXED_ONE_BYTE_STRING(isolate, "errname"), @@ -82,4 +82,4 @@ void InitializeUV(Local target, } // anonymous namespace } // namespace node -NODE_BUILTIN_MODULE_CONTEXT_AWARE(uv, node::InitializeUV) +NODE_BUILTIN_MODULE_CONTEXT_AWARE(uv, node::Initialize)