Skip to content

Commit

Permalink
test: rename target to exports for consistency
Browse files Browse the repository at this point in the history
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: #9135
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
danbev authored and jasnell committed Oct 20, 2016
1 parent 1043f5d commit bb1e606
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions test/addons/at-exit/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ static void sanity_check(void) {
assert(at_exit_cb2_called == 2);
}

void init(Local<Object> target) {
AtExit(at_exit_cb1, target->CreationContext()->GetIsolate());
void init(Local<Object> exports) {
AtExit(at_exit_cb1, exports->GetIsolate());
AtExit(at_exit_cb2, cookie);
AtExit(at_exit_cb2, cookie);
atexit(sanity_check);
Expand Down
6 changes: 3 additions & 3 deletions test/addons/buffer-free-callback/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ void Check(const v8::FunctionCallbackInfo<v8::Value>& args) {
assert(alive > 0);
}

void init(v8::Local<v8::Object> target) {
NODE_SET_METHOD(target, "alloc", Alloc);
NODE_SET_METHOD(target, "check", Check);
void init(v8::Local<v8::Object> exports) {
NODE_SET_METHOD(exports, "alloc", Alloc);
NODE_SET_METHOD(exports, "check", Check);
}

NODE_MODULE(binding, init);
4 changes: 2 additions & 2 deletions test/addons/hello-world/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world"));
}

void init(v8::Local<v8::Object> target) {
NODE_SET_METHOD(target, "hello", Method);
void init(v8::Local<v8::Object> exports) {
NODE_SET_METHOD(exports, "hello", Method);
}

NODE_MODULE(binding, init);
4 changes: 2 additions & 2 deletions test/addons/load-long-path/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world"));
}

void init(v8::Local<v8::Object> target) {
NODE_SET_METHOD(target, "hello", Method);
void init(v8::Local<v8::Object> exports) {
NODE_SET_METHOD(exports, "hello", Method);
}

NODE_MODULE(binding, init);
4 changes: 2 additions & 2 deletions test/addons/make-callback-recurse/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ void MakeCallback(const FunctionCallbackInfo<Value>& args) {
node::MakeCallback(isolate, recv, method, 0, nullptr);
}

void Initialize(Local<Object> target) {
NODE_SET_METHOD(target, "makeCallback", MakeCallback);
void Initialize(Local<Object> exports) {
NODE_SET_METHOD(exports, "makeCallback", MakeCallback);
}

} // namespace
Expand Down
4 changes: 2 additions & 2 deletions test/addons/make-callback/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ void MakeCallback(const v8::FunctionCallbackInfo<v8::Value>& args) {
args.GetReturnValue().Set(result);
}

void Initialize(v8::Local<v8::Object> target) {
NODE_SET_METHOD(target, "makeCallback", MakeCallback);
void Initialize(v8::Local<v8::Object> exports) {
NODE_SET_METHOD(exports, "makeCallback", MakeCallback);
}

} // namespace
Expand Down
4 changes: 2 additions & 2 deletions test/addons/null-buffer-neuter/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ void Run(const v8::FunctionCallbackInfo<v8::Value>& args) {
assert(alive == 0);
}

void init(v8::Local<v8::Object> target) {
NODE_SET_METHOD(target, "run", Run);
void init(v8::Local<v8::Object> exports) {
NODE_SET_METHOD(exports, "run", Run);
}

NODE_MODULE(binding, init);
4 changes: 2 additions & 2 deletions test/addons/parse-encoding/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ void ParseEncoding(const v8::FunctionCallbackInfo<v8::Value>& args) {
args.GetReturnValue().Set(encoding_string);
}

void Initialize(v8::Local<v8::Object> target) {
NODE_SET_METHOD(target, "parseEncoding", ParseEncoding);
void Initialize(v8::Local<v8::Object> exports) {
NODE_SET_METHOD(exports, "parseEncoding", ParseEncoding);
}

} // anonymous namespace
Expand Down
4 changes: 2 additions & 2 deletions test/addons/repl-domain-abort/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ void Method(const FunctionCallbackInfo<Value>& args) {
NULL);
}

void init(Local<Object> target) {
NODE_SET_METHOD(target, "method", Method);
void init(Local<Object> exports) {
NODE_SET_METHOD(exports, "method", Method);
}

NODE_MODULE(binding, init);
4 changes: 2 additions & 2 deletions test/addons/stringbytes-external-exceed-max/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ void EnsureAllocation(const v8::FunctionCallbackInfo<v8::Value> &args) {
args.GetReturnValue().Set(success);
}

void init(v8::Local<v8::Object> target) {
NODE_SET_METHOD(target, "ensureAllocation", EnsureAllocation);
void init(v8::Local<v8::Object> exports) {
NODE_SET_METHOD(exports, "ensureAllocation", EnsureAllocation);
}

NODE_MODULE(binding, init);
4 changes: 2 additions & 2 deletions test/addons/symlinked-module/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world"));
}

void init(v8::Local<v8::Object> target) {
NODE_SET_METHOD(target, "hello", Method);
void init(v8::Local<v8::Object> exports) {
NODE_SET_METHOD(exports, "hello", Method);
}

NODE_MODULE(binding, init);

0 comments on commit bb1e606

Please sign in to comment.