Skip to content

Commit

Permalink
src: name all builtin init functions Initialize
Browse files Browse the repository at this point in the history
This commit renames a few of the builtin modules init functions to
Initialize for consistency.

PR-URL: #19550
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
danbev authored and targos committed Apr 2, 2018
1 parent 1a38b9b commit 6c46681
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 54 deletions.
6 changes: 3 additions & 3 deletions src/inspector_js_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ void Url(const FunctionCallbackInfo<Value>& args) {
args.GetReturnValue().Set(OneByteString(env->isolate(), url.c_str()));
}

void InitInspectorBindings(Local<Object> target, Local<Value> unused,
Local<Context> context, void* priv) {
void Initialize(Local<Object> target, Local<Value> unused,
Local<Context> context, void* priv) {
Environment* env = Environment::GetCurrent(context);
{
auto obj = Object::New(env->isolate());
Expand Down Expand Up @@ -343,4 +343,4 @@ void InitInspectorBindings(Local<Object> target, Local<Value> unused,
} // namespace node

NODE_BUILTIN_MODULE_CONTEXT_AWARE(inspector,
node::inspector::InitInspectorBindings);
node::inspector::Initialize);
4 changes: 2 additions & 2 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/node_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ using v8::Value;
value, ReadOnly).FromJust(); \
} while (0)

static void InitConfig(Local<Object> target,
static void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Expand Down Expand Up @@ -138,4 +138,4 @@ static void InitConfig(Local<Object> target,

} // namespace node

NODE_BUILTIN_MODULE_CONTEXT_AWARE(config, node::InitConfig)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(config, node::Initialize)
8 changes: 4 additions & 4 deletions src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1155,9 +1155,9 @@ class ContextifyScript : public BaseObject {
};


void InitContextify(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
ContextifyContext::Init(env, target);
ContextifyScript::Init(env, target);
Expand All @@ -1166,4 +1166,4 @@ void InitContextify(Local<Object> target,
} // namespace contextify
} // namespace node

NODE_BUILTIN_MODULE_CONTEXT_AWARE(contextify, node::contextify::InitContextify)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(contextify, node::contextify::Initialize)
4 changes: 2 additions & 2 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6268,7 +6268,7 @@ void SetFipsCrypto(const FunctionCallbackInfo<Value>& args) {
}
#endif /* NODE_FIPS_MODE */

void InitCrypto(Local<Object> target,
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context,
void* priv) {
Expand Down Expand Up @@ -6341,4 +6341,4 @@ void InitCrypto(Local<Object> target,
} // namespace crypto
} // namespace node

NODE_BUILTIN_MODULE_CONTEXT_AWARE(crypto, node::crypto::InitCrypto)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(crypto, node::crypto::Initialize)
10 changes: 5 additions & 5 deletions src/node_http_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -711,10 +711,10 @@ const struct http_parser_settings Parser::settings = {
};


void InitHttpParser(Local<Object> target,
Local<Value> unused,
Local<Context> context,
void* priv) {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> t = env->NewFunctionTemplate(Parser::New);
t->InstanceTemplate()->SetInternalFieldCount(1);
Expand Down Expand Up @@ -761,4 +761,4 @@ void InitHttpParser(Local<Object> target,
} // anonymous namespace
} // namespace node

NODE_BUILTIN_MODULE_CONTEXT_AWARE(http_parser, node::InitHttpParser)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(http_parser, node::Initialize)
10 changes: 5 additions & 5 deletions src/node_i18n.cc
Original file line number Diff line number Diff line change
Expand Up @@ -852,10 +852,10 @@ static void GetStringWidth(const FunctionCallbackInfo<Value>& args) {
args.GetReturnValue().Set(width);
}

void Init(Local<Object> target,
Local<Value> unused,
Local<Context> context,
void* priv) {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
env->SetMethod(target, "toUnicode", ToUnicode);
env->SetMethod(target, "toASCII", ToASCII);
Expand All @@ -875,6 +875,6 @@ void Init(Local<Object> 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
8 changes: 4 additions & 4 deletions src/node_perf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ void Timerify(const FunctionCallbackInfo<Value>& args) {
}


void Init(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Isolate* isolate = env->isolate();
performance_state* state = env->performance_state();
Expand Down Expand Up @@ -418,4 +418,4 @@ void Init(Local<Object> target,
} // namespace performance
} // namespace node

NODE_BUILTIN_MODULE_CONTEXT_AWARE(performance, node::performance::Init)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(performance, node::performance::Initialize)
8 changes: 4 additions & 4 deletions src/node_serdes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,9 @@ void DeserializerContext::ReadRawBytes(
args.GetReturnValue().Set(offset);
}

void InitializeSerdesBindings(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> ser =
env->NewFunctionTemplate(SerializerContext::New);
Expand Down Expand Up @@ -483,4 +483,4 @@ void InitializeSerdesBindings(Local<Object> target,
} // anonymous namespace
} // namespace node

NODE_BUILTIN_MODULE_CONTEXT_AWARE(serdes, node::InitializeSerdesBindings)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(serdes, node::Initialize)
10 changes: 5 additions & 5 deletions src/node_trace_events.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ static void CategoryGroupEnabled(const FunctionCallbackInfo<Value>& args) {
args.GetReturnValue().Set(*category_group_enabled > 0);
}

void InitializeTraceEvents(Local<Object> target,
Local<Value> unused,
Local<Context> context,
void* priv) {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);

env->SetMethod(target, "emit", Emit);
Expand All @@ -144,4 +144,4 @@ void InitializeTraceEvents(Local<Object> target,

} // namespace node

NODE_BUILTIN_MODULE_CONTEXT_AWARE(trace_events, node::InitializeTraceEvents)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(trace_events, node::Initialize)
10 changes: 5 additions & 5 deletions src/node_url.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2290,10 +2290,10 @@ static void SetURLConstructor(const FunctionCallbackInfo<Value>& args) {
env->set_url_constructor_function(args[0].As<Function>());
}

static void Init(Local<Object> target,
Local<Value> unused,
Local<Context> context,
void* priv) {
static void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
env->SetMethod(target, "parse", Parse);
env->SetMethod(target, "encodeAuth", EncodeAuthSet);
Expand All @@ -2313,4 +2313,4 @@ static void Init(Local<Object> target,
} // namespace url
} // namespace node

NODE_BUILTIN_MODULE_CONTEXT_AWARE(url, node::url::Init)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(url, node::url::Initialize)
8 changes: 4 additions & 4 deletions src/node_v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ void SetFlagsFromString(const FunctionCallbackInfo<Value>& args) {
}


void InitializeV8Bindings(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Environment* env = Environment::GetCurrent(context);

env->SetMethod(target, "cachedDataVersionTag", CachedDataVersionTag);
Expand Down Expand Up @@ -201,4 +201,4 @@ void InitializeV8Bindings(Local<Object> target,

} // namespace node

NODE_BUILTIN_MODULE_CONTEXT_AWARE(v8, node::InitializeV8Bindings)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(v8, node::Initialize)
10 changes: 5 additions & 5 deletions src/node_zlib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -681,10 +681,10 @@ class ZCtx : public AsyncWrap {
};


void InitZlib(Local<Object> target,
Local<Value> unused,
Local<Context> context,
void* priv) {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> z = env->NewFunctionTemplate(ZCtx::New);

Expand All @@ -709,4 +709,4 @@ void InitZlib(Local<Object> target,
} // anonymous namespace
} // namespace node

NODE_BUILTIN_MODULE_CONTEXT_AWARE(zlib, node::InitZlib)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(zlib, node::Initialize)
8 changes: 4 additions & 4 deletions src/uv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ void ErrName(const FunctionCallbackInfo<Value>& args) {
}


void InitializeUV(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Isolate* isolate = env->isolate();
target->Set(FIXED_ONE_BYTE_STRING(isolate, "errname"),
Expand Down Expand Up @@ -82,4 +82,4 @@ void InitializeUV(Local<Object> target,
} // anonymous namespace
} // namespace node

NODE_BUILTIN_MODULE_CONTEXT_AWARE(uv, node::InitializeUV)
NODE_BUILTIN_MODULE_CONTEXT_AWARE(uv, node::Initialize)

0 comments on commit 6c46681

Please sign in to comment.