From 09d41e22cc9bd3c35b454dc239c616be12e26a73 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 17 Oct 2016 18:53:40 +0200 Subject: [PATCH] test: rename target to exports for consistency The doc/api/addons.md document contains examples of Addon Initialization functions that take a parameter named exports. This also matches the name used in node.cc when calling: mp->nm_register_func(exports, module, mp->nm_priv); Currently, a number of the tests name this same parameter target. This commit renames target to exports for consistency. PR-URL: https://github.com/nodejs/node/pull/9135 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- test/addons/at-exit/binding.cc | 4 ++-- test/addons/buffer-free-callback/binding.cc | 6 +++--- test/addons/hello-world/binding.cc | 4 ++-- test/addons/load-long-path/binding.cc | 4 ++-- test/addons/make-callback-recurse/binding.cc | 4 ++-- test/addons/make-callback/binding.cc | 4 ++-- test/addons/null-buffer-neuter/binding.cc | 4 ++-- test/addons/parse-encoding/binding.cc | 4 ++-- test/addons/repl-domain-abort/binding.cc | 4 ++-- test/addons/stringbytes-external-exceed-max/binding.cc | 4 ++-- test/addons/symlinked-module/binding.cc | 4 ++-- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/test/addons/at-exit/binding.cc b/test/addons/at-exit/binding.cc index 5210de298b..8f9d0b461c 100644 --- a/test/addons/at-exit/binding.cc +++ b/test/addons/at-exit/binding.cc @@ -33,8 +33,8 @@ static void sanity_check(void) { assert(at_exit_cb2_called == 2); } -void init(Local target) { - AtExit(at_exit_cb1, target->CreationContext()->GetIsolate()); +void init(Local exports) { + AtExit(at_exit_cb1, exports->GetIsolate()); AtExit(at_exit_cb2, cookie); AtExit(at_exit_cb2, cookie); atexit(sanity_check); diff --git a/test/addons/buffer-free-callback/binding.cc b/test/addons/buffer-free-callback/binding.cc index a72386fdd6..5c95f594e7 100644 --- a/test/addons/buffer-free-callback/binding.cc +++ b/test/addons/buffer-free-callback/binding.cc @@ -36,9 +36,9 @@ void Check(const v8::FunctionCallbackInfo& args) { assert(alive > 0); } -void init(v8::Local target) { - NODE_SET_METHOD(target, "alloc", Alloc); - NODE_SET_METHOD(target, "check", Check); +void init(v8::Local exports) { + NODE_SET_METHOD(exports, "alloc", Alloc); + NODE_SET_METHOD(exports, "check", Check); } NODE_MODULE(binding, init); diff --git a/test/addons/hello-world/binding.cc b/test/addons/hello-world/binding.cc index b21f87d0fd..8a8145f016 100644 --- a/test/addons/hello-world/binding.cc +++ b/test/addons/hello-world/binding.cc @@ -7,8 +7,8 @@ void Method(const v8::FunctionCallbackInfo& args) { args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world")); } -void init(v8::Local target) { - NODE_SET_METHOD(target, "hello", Method); +void init(v8::Local exports) { + NODE_SET_METHOD(exports, "hello", Method); } NODE_MODULE(binding, init); diff --git a/test/addons/load-long-path/binding.cc b/test/addons/load-long-path/binding.cc index cdf9904e3f..1cdcb4c200 100644 --- a/test/addons/load-long-path/binding.cc +++ b/test/addons/load-long-path/binding.cc @@ -6,8 +6,8 @@ void Method(const v8::FunctionCallbackInfo& args) { args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world")); } -void init(v8::Local target) { - NODE_SET_METHOD(target, "hello", Method); +void init(v8::Local exports) { + NODE_SET_METHOD(exports, "hello", Method); } NODE_MODULE(binding, init); diff --git a/test/addons/make-callback-recurse/binding.cc b/test/addons/make-callback-recurse/binding.cc index 3e3a146493..4ca5426f9e 100644 --- a/test/addons/make-callback-recurse/binding.cc +++ b/test/addons/make-callback-recurse/binding.cc @@ -22,8 +22,8 @@ void MakeCallback(const FunctionCallbackInfo& args) { node::MakeCallback(isolate, recv, method, 0, nullptr); } -void Initialize(Local target) { - NODE_SET_METHOD(target, "makeCallback", MakeCallback); +void Initialize(Local exports) { + NODE_SET_METHOD(exports, "makeCallback", MakeCallback); } } // namespace diff --git a/test/addons/make-callback/binding.cc b/test/addons/make-callback/binding.cc index 8970e9fb1a..3b56c385ec 100644 --- a/test/addons/make-callback/binding.cc +++ b/test/addons/make-callback/binding.cc @@ -30,8 +30,8 @@ void MakeCallback(const v8::FunctionCallbackInfo& args) { args.GetReturnValue().Set(result); } -void Initialize(v8::Local target) { - NODE_SET_METHOD(target, "makeCallback", MakeCallback); +void Initialize(v8::Local exports) { + NODE_SET_METHOD(exports, "makeCallback", MakeCallback); } } // namespace diff --git a/test/addons/null-buffer-neuter/binding.cc b/test/addons/null-buffer-neuter/binding.cc index 532e228833..d0f26d4cc5 100644 --- a/test/addons/null-buffer-neuter/binding.cc +++ b/test/addons/null-buffer-neuter/binding.cc @@ -34,8 +34,8 @@ void Run(const v8::FunctionCallbackInfo& args) { assert(alive == 0); } -void init(v8::Local target) { - NODE_SET_METHOD(target, "run", Run); +void init(v8::Local exports) { + NODE_SET_METHOD(exports, "run", Run); } NODE_MODULE(binding, init); diff --git a/test/addons/parse-encoding/binding.cc b/test/addons/parse-encoding/binding.cc index 0a31569e03..5c56d97fc6 100644 --- a/test/addons/parse-encoding/binding.cc +++ b/test/addons/parse-encoding/binding.cc @@ -29,8 +29,8 @@ void ParseEncoding(const v8::FunctionCallbackInfo& args) { args.GetReturnValue().Set(encoding_string); } -void Initialize(v8::Local target) { - NODE_SET_METHOD(target, "parseEncoding", ParseEncoding); +void Initialize(v8::Local exports) { + NODE_SET_METHOD(exports, "parseEncoding", ParseEncoding); } } // anonymous namespace diff --git a/test/addons/repl-domain-abort/binding.cc b/test/addons/repl-domain-abort/binding.cc index 7d9b6e5513..e7415c317f 100644 --- a/test/addons/repl-domain-abort/binding.cc +++ b/test/addons/repl-domain-abort/binding.cc @@ -19,8 +19,8 @@ void Method(const FunctionCallbackInfo& args) { NULL); } -void init(Local target) { - NODE_SET_METHOD(target, "method", Method); +void init(Local exports) { + NODE_SET_METHOD(exports, "method", Method); } NODE_MODULE(binding, init); diff --git a/test/addons/stringbytes-external-exceed-max/binding.cc b/test/addons/stringbytes-external-exceed-max/binding.cc index 65390852c2..03fa29f273 100644 --- a/test/addons/stringbytes-external-exceed-max/binding.cc +++ b/test/addons/stringbytes-external-exceed-max/binding.cc @@ -17,8 +17,8 @@ void EnsureAllocation(const v8::FunctionCallbackInfo &args) { args.GetReturnValue().Set(success); } -void init(v8::Local target) { - NODE_SET_METHOD(target, "ensureAllocation", EnsureAllocation); +void init(v8::Local exports) { + NODE_SET_METHOD(exports, "ensureAllocation", EnsureAllocation); } NODE_MODULE(binding, init); diff --git a/test/addons/symlinked-module/binding.cc b/test/addons/symlinked-module/binding.cc index cdf9904e3f..1cdcb4c200 100644 --- a/test/addons/symlinked-module/binding.cc +++ b/test/addons/symlinked-module/binding.cc @@ -6,8 +6,8 @@ void Method(const v8::FunctionCallbackInfo& args) { args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world")); } -void init(v8::Local target) { - NODE_SET_METHOD(target, "hello", Method); +void init(v8::Local exports) { + NODE_SET_METHOD(exports, "hello", Method); } NODE_MODULE(binding, init);