Skip to content

Commit 02260ea

Browse files
Gabriel SchulhofMylesBorins
authored andcommitted
test,doc: make module name match gyp target name
Currently the nm_modname does not match the file name of the resulting module. In fact, the nm_modname is pretty arbitrary. This seeks to introduce some consistency into the nm_modname property by having the name of the module appear in exactly one place: the "target_name" property of the gyp target that builds the module. PR-URL: #15209 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent ffed337 commit 02260ea

File tree

53 files changed

+63
-63
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+63
-63
lines changed

benchmark/misc/function_call/binding.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ extern "C" void init (Local<Object> target) {
1414
NODE_SET_METHOD(target, "hello", Hello);
1515
}
1616

17-
NODE_MODULE(binding, init)
17+
NODE_MODULE(NODE_GYP_MODULE_NAME, init)

doc/api/addons.md

Lines changed: 10 additions & 10 deletions

doc/api/n-api.md

Lines changed: 2 additions & 2 deletions

test/addons-napi/1_hello_world/binding.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
1515
NAPI_CALL_RETURN_VOID(env, napi_define_properties(env, exports, 1, &desc));
1616
}
1717

18-
NAPI_MODULE(addon, Init)
18+
NAPI_MODULE(NODE_GYP_MODULE_NAME, Init)

test/addons-napi/2_function_arguments/binding.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
3434
NAPI_CALL_RETURN_VOID(env, napi_define_properties(env, exports, 1, &desc));
3535
}
3636

37-
NAPI_MODULE(addon, Init)
37+
NAPI_MODULE(NODE_GYP_MODULE_NAME, Init)

test/addons-napi/3_callbacks/binding.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
5353
NAPI_CALL_RETURN_VOID(env, napi_define_properties(env, exports, 2, desc));
5454
}
5555

56-
NAPI_MODULE(addon, Init)
56+
NAPI_MODULE(NODE_GYP_MODULE_NAME, Init)

test/addons-napi/4_object_factory/binding.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
2020
NAPI_CALL_RETURN_VOID(env, napi_define_properties(env, module, 1, &desc));
2121
}
2222

23-
NAPI_MODULE(addon, Init)
23+
NAPI_MODULE(NODE_GYP_MODULE_NAME, Init)

test/addons-napi/5_function_factory/binding.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
2222
NAPI_CALL_RETURN_VOID(env, napi_define_properties(env, module, 1, &desc));
2323
}
2424

25-
NAPI_MODULE(addon, Init)
25+
NAPI_MODULE(NODE_GYP_MODULE_NAME, Init)

test/addons-napi/6_object_wrap/binding.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
44
MyObject::Init(env, exports);
55
}
66

7-
NAPI_MODULE(addon, Init)
7+
NAPI_MODULE(NODE_GYP_MODULE_NAME, Init)

test/addons-napi/7_factory_wrap/binding.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
2020
NAPI_CALL_RETURN_VOID(env, napi_define_properties(env, module, 1, &desc));
2121
}
2222

23-
NAPI_MODULE(addon, Init)
23+
NAPI_MODULE(NODE_GYP_MODULE_NAME, Init)

0 commit comments

Comments
 (0)