From 78286984da50ed7f0ed8914b587da62c552277ce Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Tue, 5 Sep 2017 23:53:06 +0300 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/15209 Reviewed-By: Refael Ackermann Reviewed-By: Colin Ihrig --- benchmark/misc/function_call/binding.cc | 2 +- doc/api/addons.md | 20 +++++++++---------- doc/api/n-api.md | 4 ++-- test/addons-napi/1_hello_world/binding.c | 2 +- .../2_function_arguments/binding.c | 2 +- test/addons-napi/3_callbacks/binding.c | 2 +- test/addons-napi/4_object_factory/binding.c | 2 +- test/addons-napi/5_function_factory/binding.c | 2 +- test/addons-napi/6_object_wrap/binding.cc | 2 +- test/addons-napi/7_factory_wrap/binding.cc | 2 +- test/addons-napi/8_passing_wrapped/binding.cc | 2 +- test/addons-napi/test_array/test_array.c | 2 +- test/addons-napi/test_async/test_async.cc | 2 +- test/addons-napi/test_buffer/test_buffer.c | 2 +- .../test_constructor/test_constructor.c | 2 +- .../test_conversions/test_conversions.c | 2 +- .../addons-napi/test_dataview/test_dataview.c | 2 +- .../test_env_sharing/compare_env.c | 2 +- test/addons-napi/test_env_sharing/store_env.c | 2 +- test/addons-napi/test_error/test_error.cc | 2 +- .../test_exception/test_exception.c | 2 +- test/addons-napi/test_fatal/test_fatal.c | 2 +- .../addons-napi/test_function/test_function.c | 2 +- test/addons-napi/test_general/test_general.c | 2 +- .../test_handle_scope/test_handle_scope.c | 2 +- .../addons-napi/test_make_callback/binding.cc | 2 +- .../test_make_callback_recurse/binding.cc | 2 +- test/addons-napi/test_number/test_number.c | 2 +- test/addons-napi/test_object/test_object.c | 2 +- test/addons-napi/test_promise/test_promise.c | 2 +- .../test_properties/test_properties.c | 2 +- .../test_reference/test_reference.c | 2 +- test/addons-napi/test_string/test_string.c | 2 +- test/addons-napi/test_symbol/test_symbol.c | 2 +- .../test_typedarray/test_typedarray.c | 2 +- test/addons/async-hello-world/binding.cc | 2 +- test/addons/async-hooks-id/binding.cc | 2 +- test/addons/async-hooks-promise/binding.cc | 2 +- test/addons/async-resource/binding.cc | 2 +- test/addons/at-exit/binding.cc | 2 +- test/addons/buffer-free-callback/binding.cc | 2 +- test/addons/errno-exception/binding.cc | 2 +- test/addons/heap-profiler/binding.cc | 2 +- .../hello-world-function-export/binding.cc | 2 +- test/addons/hello-world/binding.cc | 2 +- test/addons/load-long-path/binding.cc | 2 +- test/addons/make-callback-recurse/binding.cc | 2 +- test/addons/make-callback/binding.cc | 2 +- test/addons/new-target/binding.cc | 2 +- test/addons/null-buffer-neuter/binding.cc | 2 +- test/addons/parse-encoding/binding.cc | 2 +- test/addons/repl-domain-abort/binding.cc | 2 +- .../binding.cc | 2 +- test/addons/symlinked-module/binding.cc | 2 +- 54 files changed, 64 insertions(+), 64 deletions(-) diff --git a/benchmark/misc/function_call/binding.cc b/benchmark/misc/function_call/binding.cc index 9008f6c437052a..95d2a56de26e87 100644 --- a/benchmark/misc/function_call/binding.cc +++ b/benchmark/misc/function_call/binding.cc @@ -14,4 +14,4 @@ extern "C" void init (Local target) { NODE_SET_METHOD(target, "hello", Hello); } -NODE_MODULE(binding, init) +NODE_MODULE(NODE_GYP_MODULE_NAME, init) diff --git a/doc/api/addons.md b/doc/api/addons.md index bd175103330da7..b031c273e7e66b 100644 --- a/doc/api/addons.md +++ b/doc/api/addons.md @@ -74,7 +74,7 @@ void init(Local exports) { NODE_SET_METHOD(exports, "hello", Method); } -NODE_MODULE(addon, init) +NODE_MODULE(NODE_GYP_MODULE_NAME, init) } // namespace demo ``` @@ -84,7 +84,7 @@ the pattern: ```cpp void Initialize(Local exports); -NODE_MODULE(module_name, Initialize) +NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize) ``` There is no semi-colon after `NODE_MODULE` as it's not a function (see @@ -330,7 +330,7 @@ void Init(Local exports) { NODE_SET_METHOD(exports, "add", Add); } -NODE_MODULE(addon, Init) +NODE_MODULE(NODE_GYP_MODULE_NAME, Init) } // namespace demo ``` @@ -378,7 +378,7 @@ void Init(Local exports, Local module) { NODE_SET_METHOD(module, "exports", RunCallback); } -NODE_MODULE(addon, Init) +NODE_MODULE(NODE_GYP_MODULE_NAME, Init) } // namespace demo ``` @@ -434,7 +434,7 @@ void Init(Local exports, Local module) { NODE_SET_METHOD(module, "exports", CreateObject); } -NODE_MODULE(addon, Init) +NODE_MODULE(NODE_GYP_MODULE_NAME, Init) } // namespace demo ``` @@ -493,7 +493,7 @@ void Init(Local exports, Local module) { NODE_SET_METHOD(module, "exports", CreateFunction); } -NODE_MODULE(addon, Init) +NODE_MODULE(NODE_GYP_MODULE_NAME, Init) } // namespace demo ``` @@ -529,7 +529,7 @@ void InitAll(Local exports) { MyObject::Init(exports); } -NODE_MODULE(addon, InitAll) +NODE_MODULE(NODE_GYP_MODULE_NAME, InitAll) } // namespace demo ``` @@ -713,7 +713,7 @@ void InitAll(Local exports, Local module) { NODE_SET_METHOD(module, "exports", CreateObject); } -NODE_MODULE(addon, InitAll) +NODE_MODULE(NODE_GYP_MODULE_NAME, InitAll) } // namespace demo ``` @@ -926,7 +926,7 @@ void InitAll(Local exports) { NODE_SET_METHOD(exports, "add", Add); } -NODE_MODULE(addon, InitAll) +NODE_MODULE(NODE_GYP_MODULE_NAME, InitAll) } // namespace demo ``` @@ -1117,7 +1117,7 @@ void init(Local exports) { AtExit(sanity_check); } -NODE_MODULE(addon, init) +NODE_MODULE(NODE_GYP_MODULE_NAME, init) } // namespace demo ``` diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 3a3cce03646821..6269259260e42a 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -877,7 +877,7 @@ except that instead of using the `NODE_MODULE` macro the following is used: ```C -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) ``` The next difference is the signature for the `Init` method. For a N-API @@ -2874,7 +2874,7 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { if (status != napi_ok) return; } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) ``` Given the above code, the add-on can be used from JavaScript as follows: diff --git a/test/addons-napi/1_hello_world/binding.c b/test/addons-napi/1_hello_world/binding.c index 57bac37fa0bfd1..785484d1676fa6 100644 --- a/test/addons-napi/1_hello_world/binding.c +++ b/test/addons-napi/1_hello_world/binding.c @@ -15,4 +15,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { NAPI_CALL_RETURN_VOID(env, napi_define_properties(env, exports, 1, &desc)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/2_function_arguments/binding.c b/test/addons-napi/2_function_arguments/binding.c index 92f89fd2ffa199..977547bb6f7cbc 100644 --- a/test/addons-napi/2_function_arguments/binding.c +++ b/test/addons-napi/2_function_arguments/binding.c @@ -34,4 +34,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { NAPI_CALL_RETURN_VOID(env, napi_define_properties(env, exports, 1, &desc)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/3_callbacks/binding.c b/test/addons-napi/3_callbacks/binding.c index 8640a936107d47..4249ebc7686a80 100644 --- a/test/addons-napi/3_callbacks/binding.c +++ b/test/addons-napi/3_callbacks/binding.c @@ -53,4 +53,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { NAPI_CALL_RETURN_VOID(env, napi_define_properties(env, exports, 2, desc)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/4_object_factory/binding.c b/test/addons-napi/4_object_factory/binding.c index d76f30b847a237..54c39d8515911b 100644 --- a/test/addons-napi/4_object_factory/binding.c +++ b/test/addons-napi/4_object_factory/binding.c @@ -20,4 +20,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { NAPI_CALL_RETURN_VOID(env, napi_define_properties(env, module, 1, &desc)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/5_function_factory/binding.c b/test/addons-napi/5_function_factory/binding.c index 4c20190f5047cd..789331bef22e21 100644 --- a/test/addons-napi/5_function_factory/binding.c +++ b/test/addons-napi/5_function_factory/binding.c @@ -22,4 +22,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { NAPI_CALL_RETURN_VOID(env, napi_define_properties(env, module, 1, &desc)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/6_object_wrap/binding.cc b/test/addons-napi/6_object_wrap/binding.cc index 99d8339bd09ef3..5681550541a3fa 100644 --- a/test/addons-napi/6_object_wrap/binding.cc +++ b/test/addons-napi/6_object_wrap/binding.cc @@ -4,4 +4,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { MyObject::Init(env, exports); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/7_factory_wrap/binding.cc b/test/addons-napi/7_factory_wrap/binding.cc index c61e4094784ed7..16946b7520009a 100644 --- a/test/addons-napi/7_factory_wrap/binding.cc +++ b/test/addons-napi/7_factory_wrap/binding.cc @@ -20,4 +20,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { NAPI_CALL_RETURN_VOID(env, napi_define_properties(env, module, 1, &desc)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/8_passing_wrapped/binding.cc b/test/addons-napi/8_passing_wrapped/binding.cc index c22ac6442f6c4e..408d0617106a22 100644 --- a/test/addons-napi/8_passing_wrapped/binding.cc +++ b/test/addons-napi/8_passing_wrapped/binding.cc @@ -41,4 +41,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { napi_define_properties(env, exports, sizeof(desc) / sizeof(*desc), desc)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_array/test_array.c b/test/addons-napi/test_array/test_array.c index 4bb12d4e01e8fa..90448f3ebbd7b9 100644 --- a/test/addons-napi/test_array/test_array.c +++ b/test/addons-napi/test_array/test_array.c @@ -182,4 +182,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { env, exports, sizeof(descriptors) / sizeof(*descriptors), descriptors)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_async/test_async.cc b/test/addons-napi/test_async/test_async.cc index ca76fa2d33b132..fd5278d7d5cc20 100644 --- a/test/addons-napi/test_async/test_async.cc +++ b/test/addons-napi/test_async/test_async.cc @@ -170,4 +170,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { env, exports, sizeof(properties) / sizeof(*properties), properties)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_buffer/test_buffer.c b/test/addons-napi/test_buffer/test_buffer.c index 0e12bedfb5602f..546b306ec6527d 100644 --- a/test/addons-napi/test_buffer/test_buffer.c +++ b/test/addons-napi/test_buffer/test_buffer.c @@ -141,4 +141,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { env, exports, sizeof(methods) / sizeof(methods[0]), methods)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_constructor/test_constructor.c b/test/addons-napi/test_constructor/test_constructor.c index a991dab8533bf1..2d3c5dbe9ffd46 100644 --- a/test/addons-napi/test_constructor/test_constructor.c +++ b/test/addons-napi/test_constructor/test_constructor.c @@ -87,4 +87,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { napi_create_reference(env, cons, 1, &constructor_)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_conversions/test_conversions.c b/test/addons-napi/test_conversions/test_conversions.c index a8d526c763c9a2..36f4a11ac4d5b6 100644 --- a/test/addons-napi/test_conversions/test_conversions.c +++ b/test/addons-napi/test_conversions/test_conversions.c @@ -148,4 +148,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { env, exports, sizeof(descriptors) / sizeof(*descriptors), descriptors)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_dataview/test_dataview.c b/test/addons-napi/test_dataview/test_dataview.c index 4060e4d2666c44..66470552f28a7f 100644 --- a/test/addons-napi/test_dataview/test_dataview.c +++ b/test/addons-napi/test_dataview/test_dataview.c @@ -46,4 +46,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { env, exports, sizeof(descriptors) / sizeof(*descriptors), descriptors)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_env_sharing/compare_env.c b/test/addons-napi/test_env_sharing/compare_env.c index b209c8f6d8e968..6488789a0b5759 100644 --- a/test/addons-napi/test_env_sharing/compare_env.c +++ b/test/addons-napi/test_env_sharing/compare_env.c @@ -19,4 +19,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* context) { NAPI_CALL_RETURN_VOID(env, napi_define_properties(env, module, 1, &prop)); } -NAPI_MODULE(compare_env, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_env_sharing/store_env.c b/test/addons-napi/test_env_sharing/store_env.c index 391f6faa27648e..b2b1772a696dac 100644 --- a/test/addons-napi/test_env_sharing/store_env.c +++ b/test/addons-napi/test_env_sharing/store_env.c @@ -9,4 +9,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* context) { napi_set_named_property(env, module, "exports", external)); } -NAPI_MODULE(store_env, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_error/test_error.cc b/test/addons-napi/test_error/test_error.cc index 29aba1f1ef62f6..4ef279d1fe4f65 100644 --- a/test/addons-napi/test_error/test_error.cc +++ b/test/addons-napi/test_error/test_error.cc @@ -141,4 +141,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { env, exports, sizeof(descriptors) / sizeof(*descriptors), descriptors)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_exception/test_exception.c b/test/addons-napi/test_exception/test_exception.c index 191ac3f8ba5aec..3a4e91a731b407 100644 --- a/test/addons-napi/test_exception/test_exception.c +++ b/test/addons-napi/test_exception/test_exception.c @@ -56,4 +56,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { env, exports, sizeof(descriptors) / sizeof(*descriptors), descriptors)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_fatal/test_fatal.c b/test/addons-napi/test_fatal/test_fatal.c index 1e8a1cf7955d18..74fe3f132d56b6 100644 --- a/test/addons-napi/test_fatal/test_fatal.c +++ b/test/addons-napi/test_fatal/test_fatal.c @@ -15,4 +15,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { env, exports, sizeof(properties) / sizeof(*properties), properties)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_function/test_function.c b/test/addons-napi/test_function/test_function.c index 4ce0203e7232dd..b044de3b1e2c64 100644 --- a/test/addons-napi/test_function/test_function.c +++ b/test/addons-napi/test_function/test_function.c @@ -32,4 +32,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, exports, "Test", fn)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_general/test_general.c b/test/addons-napi/test_general/test_general.c index ea1f2ece0a5d30..3052a93a71ef45 100644 --- a/test/addons-napi/test_general/test_general.c +++ b/test/addons-napi/test_general/test_general.c @@ -239,4 +239,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { env, exports, sizeof(descriptors) / sizeof(*descriptors), descriptors)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_handle_scope/test_handle_scope.c b/test/addons-napi/test_handle_scope/test_handle_scope.c index 6637da82316185..d6b0653f2aa9da 100644 --- a/test/addons-napi/test_handle_scope/test_handle_scope.c +++ b/test/addons-napi/test_handle_scope/test_handle_scope.c @@ -78,4 +78,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { env, exports, sizeof(properties) / sizeof(*properties), properties)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_make_callback/binding.cc b/test/addons-napi/test_make_callback/binding.cc index 987b024098598c..526131ab739308 100644 --- a/test/addons-napi/test_make_callback/binding.cc +++ b/test/addons-napi/test_make_callback/binding.cc @@ -45,4 +45,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { } // namespace -NAPI_MODULE(binding, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_make_callback_recurse/binding.cc b/test/addons-napi/test_make_callback_recurse/binding.cc index 3f5a4c28b43524..75c0399cdba0c4 100644 --- a/test/addons-napi/test_make_callback_recurse/binding.cc +++ b/test/addons-napi/test_make_callback_recurse/binding.cc @@ -29,4 +29,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { } // namespace -NAPI_MODULE(binding, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_number/test_number.c b/test/addons-napi/test_number/test_number.c index 6b28afe18ff9e8..bd7f0679372313 100644 --- a/test/addons-napi/test_number/test_number.c +++ b/test/addons-napi/test_number/test_number.c @@ -55,4 +55,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { env, exports, sizeof(descriptors) / sizeof(*descriptors), descriptors)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_object/test_object.c b/test/addons-napi/test_object/test_object.c index 88ac79c170f5ea..c6fa27e30c3e73 100644 --- a/test/addons-napi/test_object/test_object.c +++ b/test/addons-napi/test_object/test_object.c @@ -236,4 +236,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { env, exports, sizeof(descriptors) / sizeof(*descriptors), descriptors)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_promise/test_promise.c b/test/addons-napi/test_promise/test_promise.c index dc617f4592e520..d21564e93f5c8d 100644 --- a/test/addons-napi/test_promise/test_promise.c +++ b/test/addons-napi/test_promise/test_promise.c @@ -57,4 +57,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { env, exports, sizeof(descriptors) / sizeof(*descriptors), descriptors)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_properties/test_properties.c b/test/addons-napi/test_properties/test_properties.c index 3f4f0a6bcbba96..7c5d6b1d6f1532 100644 --- a/test/addons-napi/test_properties/test_properties.c +++ b/test/addons-napi/test_properties/test_properties.c @@ -97,4 +97,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { env, exports, sizeof(properties) / sizeof(*properties), properties)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_reference/test_reference.c b/test/addons-napi/test_reference/test_reference.c index b16e10d70361b5..f10b40bf5e3b51 100644 --- a/test/addons-napi/test_reference/test_reference.c +++ b/test/addons-napi/test_reference/test_reference.c @@ -150,4 +150,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { env, exports, sizeof(descriptors) / sizeof(*descriptors), descriptors)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_string/test_string.c b/test/addons-napi/test_string/test_string.c index ec80e2c7b57fa8..34285b3b5935f2 100644 --- a/test/addons-napi/test_string/test_string.c +++ b/test/addons-napi/test_string/test_string.c @@ -217,4 +217,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { env, exports, sizeof(properties) / sizeof(*properties), properties)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_symbol/test_symbol.c b/test/addons-napi/test_symbol/test_symbol.c index f85567c071e256..42425c052c22f8 100644 --- a/test/addons-napi/test_symbol/test_symbol.c +++ b/test/addons-napi/test_symbol/test_symbol.c @@ -57,4 +57,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { env, exports, sizeof(properties) / sizeof(*properties), properties)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons-napi/test_typedarray/test_typedarray.c b/test/addons-napi/test_typedarray/test_typedarray.c index ffc118681bad9e..a138297d49a61d 100644 --- a/test/addons-napi/test_typedarray/test_typedarray.c +++ b/test/addons-napi/test_typedarray/test_typedarray.c @@ -153,4 +153,4 @@ void Init(napi_env env, napi_value exports, napi_value module, void* priv) { env, exports, sizeof(descriptors) / sizeof(*descriptors), descriptors)); } -NAPI_MODULE(addon, Init) +NAPI_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/addons/async-hello-world/binding.cc b/test/addons/async-hello-world/binding.cc index 42291c49011fb3..f773bfffcdb95d 100644 --- a/test/addons/async-hello-world/binding.cc +++ b/test/addons/async-hello-world/binding.cc @@ -88,4 +88,4 @@ void init(v8::Local exports, v8::Local module) { NODE_SET_METHOD(exports, "runMakeCallback", Method); } -NODE_MODULE(binding, init) +NODE_MODULE(NODE_GYP_MODULE_NAME, init) diff --git a/test/addons/async-hooks-id/binding.cc b/test/addons/async-hooks-id/binding.cc index 611c250e9a27e4..d6d0385e617050 100644 --- a/test/addons/async-hooks-id/binding.cc +++ b/test/addons/async-hooks-id/binding.cc @@ -24,4 +24,4 @@ void Initialize(Local exports) { } // namespace -NODE_MODULE(binding, Initialize) +NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize) diff --git a/test/addons/async-hooks-promise/binding.cc b/test/addons/async-hooks-promise/binding.cc index fb91b936e66d28..1571690edead24 100644 --- a/test/addons/async-hooks-promise/binding.cc +++ b/test/addons/async-hooks-promise/binding.cc @@ -38,6 +38,6 @@ inline void Initialize(v8::Local binding) { NODE_SET_METHOD(binding, "getPromiseField", GetPromiseField); } -NODE_MODULE(binding, Initialize) +NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize) } // anonymous namespace diff --git a/test/addons/async-resource/binding.cc b/test/addons/async-resource/binding.cc index 9d3ab37e12a838..83629e757dedfc 100644 --- a/test/addons/async-resource/binding.cc +++ b/test/addons/async-resource/binding.cc @@ -111,4 +111,4 @@ void Initialize(Local exports) { } // namespace -NODE_MODULE(binding, Initialize) +NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize) diff --git a/test/addons/at-exit/binding.cc b/test/addons/at-exit/binding.cc index d90b3f70c2560b..4dd9b0f304758f 100644 --- a/test/addons/at-exit/binding.cc +++ b/test/addons/at-exit/binding.cc @@ -39,4 +39,4 @@ void init(Local exports) { atexit(sanity_check); } -NODE_MODULE(binding, init) +NODE_MODULE(NODE_GYP_MODULE_NAME, init) diff --git a/test/addons/buffer-free-callback/binding.cc b/test/addons/buffer-free-callback/binding.cc index 24b5dea6025db6..4075fef50dcb0b 100644 --- a/test/addons/buffer-free-callback/binding.cc +++ b/test/addons/buffer-free-callback/binding.cc @@ -41,4 +41,4 @@ void init(v8::Local exports) { NODE_SET_METHOD(exports, "check", Check); } -NODE_MODULE(binding, init) +NODE_MODULE(NODE_GYP_MODULE_NAME, init) diff --git a/test/addons/errno-exception/binding.cc b/test/addons/errno-exception/binding.cc index 1c3147ff7a2172..bf83fb216824f0 100644 --- a/test/addons/errno-exception/binding.cc +++ b/test/addons/errno-exception/binding.cc @@ -15,4 +15,4 @@ void init(v8::Local exports) { NODE_SET_METHOD(exports, "errno", Method); } -NODE_MODULE(binding, init) +NODE_MODULE(NODE_GYP_MODULE_NAME, init) diff --git a/test/addons/heap-profiler/binding.cc b/test/addons/heap-profiler/binding.cc index 0830aae1beceac..09feefa66902aa 100644 --- a/test/addons/heap-profiler/binding.cc +++ b/test/addons/heap-profiler/binding.cc @@ -22,6 +22,6 @@ inline void Initialize(v8::Local binding) { v8::FunctionTemplate::New(isolate, Test)->GetFunction()); } -NODE_MODULE(test, Initialize) +NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize) } // anonymous namespace diff --git a/test/addons/hello-world-function-export/binding.cc b/test/addons/hello-world-function-export/binding.cc index 9a93a806e7156e..55d64b3d6c3513 100644 --- a/test/addons/hello-world-function-export/binding.cc +++ b/test/addons/hello-world-function-export/binding.cc @@ -10,4 +10,4 @@ void init(v8::Local exports, v8::Local module) { NODE_SET_METHOD(module, "exports", Method); } -NODE_MODULE(binding, init) +NODE_MODULE(NODE_GYP_MODULE_NAME, init) diff --git a/test/addons/hello-world/binding.cc b/test/addons/hello-world/binding.cc index 83823ae8363cd9..944f5631956d15 100644 --- a/test/addons/hello-world/binding.cc +++ b/test/addons/hello-world/binding.cc @@ -10,4 +10,4 @@ void init(v8::Local exports) { NODE_SET_METHOD(exports, "hello", Method); } -NODE_MODULE(binding, init) +NODE_MODULE(NODE_GYP_MODULE_NAME, init) diff --git a/test/addons/load-long-path/binding.cc b/test/addons/load-long-path/binding.cc index 83823ae8363cd9..944f5631956d15 100644 --- a/test/addons/load-long-path/binding.cc +++ b/test/addons/load-long-path/binding.cc @@ -10,4 +10,4 @@ void init(v8::Local exports) { NODE_SET_METHOD(exports, "hello", Method); } -NODE_MODULE(binding, init) +NODE_MODULE(NODE_GYP_MODULE_NAME, init) diff --git a/test/addons/make-callback-recurse/binding.cc b/test/addons/make-callback-recurse/binding.cc index 4ca5426f9ec28f..c42166c7455277 100644 --- a/test/addons/make-callback-recurse/binding.cc +++ b/test/addons/make-callback-recurse/binding.cc @@ -28,4 +28,4 @@ void Initialize(Local exports) { } // namespace -NODE_MODULE(binding, Initialize) +NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize) diff --git a/test/addons/make-callback/binding.cc b/test/addons/make-callback/binding.cc index 3b56c385ecdd00..a5dfe46d773e82 100644 --- a/test/addons/make-callback/binding.cc +++ b/test/addons/make-callback/binding.cc @@ -36,4 +36,4 @@ void Initialize(v8::Local exports) { } // namespace -NODE_MODULE(binding, Initialize) +NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize) diff --git a/test/addons/new-target/binding.cc b/test/addons/new-target/binding.cc index a7e18eff70ea0d..5491c18c6e99af 100644 --- a/test/addons/new-target/binding.cc +++ b/test/addons/new-target/binding.cc @@ -11,6 +11,6 @@ inline void Initialize(v8::Local binding) { v8::FunctionTemplate::New(isolate, NewClass)->GetFunction()); } -NODE_MODULE(binding, Initialize) +NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize) } // anonymous namespace diff --git a/test/addons/null-buffer-neuter/binding.cc b/test/addons/null-buffer-neuter/binding.cc index 0d3d850304d534..4c9dbf902589d9 100644 --- a/test/addons/null-buffer-neuter/binding.cc +++ b/test/addons/null-buffer-neuter/binding.cc @@ -38,4 +38,4 @@ void init(v8::Local exports) { NODE_SET_METHOD(exports, "run", Run); } -NODE_MODULE(binding, init) +NODE_MODULE(NODE_GYP_MODULE_NAME, init) diff --git a/test/addons/parse-encoding/binding.cc b/test/addons/parse-encoding/binding.cc index 65dba5b6734dea..1501544153ad62 100644 --- a/test/addons/parse-encoding/binding.cc +++ b/test/addons/parse-encoding/binding.cc @@ -35,4 +35,4 @@ void Initialize(v8::Local exports) { } // anonymous namespace -NODE_MODULE(binding, Initialize) +NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize) diff --git a/test/addons/repl-domain-abort/binding.cc b/test/addons/repl-domain-abort/binding.cc index b2f2c74348c655..d6a825dfdd5dd8 100644 --- a/test/addons/repl-domain-abort/binding.cc +++ b/test/addons/repl-domain-abort/binding.cc @@ -42,4 +42,4 @@ void init(Local exports) { NODE_SET_METHOD(exports, "method", Method); } -NODE_MODULE(binding, init) +NODE_MODULE(NODE_GYP_MODULE_NAME, init) diff --git a/test/addons/stringbytes-external-exceed-max/binding.cc b/test/addons/stringbytes-external-exceed-max/binding.cc index 2141d2c5b948b4..628a6b691376b3 100644 --- a/test/addons/stringbytes-external-exceed-max/binding.cc +++ b/test/addons/stringbytes-external-exceed-max/binding.cc @@ -21,4 +21,4 @@ void init(v8::Local exports) { NODE_SET_METHOD(exports, "ensureAllocation", EnsureAllocation); } -NODE_MODULE(binding, init) +NODE_MODULE(NODE_GYP_MODULE_NAME, init) diff --git a/test/addons/symlinked-module/binding.cc b/test/addons/symlinked-module/binding.cc index 83823ae8363cd9..944f5631956d15 100644 --- a/test/addons/symlinked-module/binding.cc +++ b/test/addons/symlinked-module/binding.cc @@ -10,4 +10,4 @@ void init(v8::Local exports) { NODE_SET_METHOD(exports, "hello", Method); } -NODE_MODULE(binding, init) +NODE_MODULE(NODE_GYP_MODULE_NAME, init)