Skip to content

Commit 88cd4cf

Browse files
danbevMyles Borins
authored and
Myles Borins
committed
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: #9135 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 02f7e3a commit 88cd4cf

File tree

11 files changed

+23
-23
lines changed

11 files changed

+23
-23
lines changed

test/addons/at-exit/binding.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ static void sanity_check(void) {
3333
assert(at_exit_cb2_called == 2);
3434
}
3535

36-
void init(Local<Object> target) {
37-
AtExit(at_exit_cb1, target->CreationContext()->GetIsolate());
36+
void init(Local<Object> exports) {
37+
AtExit(at_exit_cb1, exports->GetIsolate());
3838
AtExit(at_exit_cb2, cookie);
3939
AtExit(at_exit_cb2, cookie);
4040
atexit(sanity_check);

test/addons/buffer-free-callback/binding.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ void Check(const v8::FunctionCallbackInfo<v8::Value>& args) {
3636
assert(alive > 0);
3737
}
3838

39-
void init(v8::Local<v8::Object> target) {
40-
NODE_SET_METHOD(target, "alloc", Alloc);
41-
NODE_SET_METHOD(target, "check", Check);
39+
void init(v8::Local<v8::Object> exports) {
40+
NODE_SET_METHOD(exports, "alloc", Alloc);
41+
NODE_SET_METHOD(exports, "check", Check);
4242
}
4343

4444
NODE_MODULE(binding, init);

test/addons/hello-world/binding.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
77
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world"));
88
}
99

10-
void init(v8::Local<v8::Object> target) {
11-
NODE_SET_METHOD(target, "hello", Method);
10+
void init(v8::Local<v8::Object> exports) {
11+
NODE_SET_METHOD(exports, "hello", Method);
1212
}
1313

1414
NODE_MODULE(binding, init);

test/addons/load-long-path/binding.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
66
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world"));
77
}
88

9-
void init(v8::Local<v8::Object> target) {
10-
NODE_SET_METHOD(target, "hello", Method);
9+
void init(v8::Local<v8::Object> exports) {
10+
NODE_SET_METHOD(exports, "hello", Method);
1111
}
1212

1313
NODE_MODULE(binding, init);

test/addons/make-callback-recurse/binding.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ void MakeCallback(const FunctionCallbackInfo<Value>& args) {
2222
node::MakeCallback(isolate, recv, method, 0, nullptr);
2323
}
2424

25-
void Initialize(Local<Object> target) {
26-
NODE_SET_METHOD(target, "makeCallback", MakeCallback);
25+
void Initialize(Local<Object> exports) {
26+
NODE_SET_METHOD(exports, "makeCallback", MakeCallback);
2727
}
2828

2929
} // namespace

test/addons/make-callback/binding.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ void MakeCallback(const v8::FunctionCallbackInfo<v8::Value>& args) {
3030
args.GetReturnValue().Set(result);
3131
}
3232

33-
void Initialize(v8::Local<v8::Object> target) {
34-
NODE_SET_METHOD(target, "makeCallback", MakeCallback);
33+
void Initialize(v8::Local<v8::Object> exports) {
34+
NODE_SET_METHOD(exports, "makeCallback", MakeCallback);
3535
}
3636

3737
} // namespace

test/addons/null-buffer-neuter/binding.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ void Run(const v8::FunctionCallbackInfo<v8::Value>& args) {
3434
assert(alive == 0);
3535
}
3636

37-
void init(v8::Local<v8::Object> target) {
38-
NODE_SET_METHOD(target, "run", Run);
37+
void init(v8::Local<v8::Object> exports) {
38+
NODE_SET_METHOD(exports, "run", Run);
3939
}
4040

4141
NODE_MODULE(binding, init);

test/addons/parse-encoding/binding.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ void ParseEncoding(const v8::FunctionCallbackInfo<v8::Value>& args) {
2929
args.GetReturnValue().Set(encoding_string);
3030
}
3131

32-
void Initialize(v8::Local<v8::Object> target) {
33-
NODE_SET_METHOD(target, "parseEncoding", ParseEncoding);
32+
void Initialize(v8::Local<v8::Object> exports) {
33+
NODE_SET_METHOD(exports, "parseEncoding", ParseEncoding);
3434
}
3535

3636
} // anonymous namespace

test/addons/repl-domain-abort/binding.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ void Method(const FunctionCallbackInfo<Value>& args) {
1919
NULL);
2020
}
2121

22-
void init(Local<Object> target) {
23-
NODE_SET_METHOD(target, "method", Method);
22+
void init(Local<Object> exports) {
23+
NODE_SET_METHOD(exports, "method", Method);
2424
}
2525

2626
NODE_MODULE(binding, init);

test/addons/stringbytes-external-exceed-max/binding.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ void EnsureAllocation(const v8::FunctionCallbackInfo<v8::Value> &args) {
1717
args.GetReturnValue().Set(success);
1818
}
1919

20-
void init(v8::Local<v8::Object> target) {
21-
NODE_SET_METHOD(target, "ensureAllocation", EnsureAllocation);
20+
void init(v8::Local<v8::Object> exports) {
21+
NODE_SET_METHOD(exports, "ensureAllocation", EnsureAllocation);
2222
}
2323

2424
NODE_MODULE(binding, init);

test/addons/symlinked-module/binding.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
66
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world"));
77
}
88

9-
void init(v8::Local<v8::Object> target) {
10-
NODE_SET_METHOD(target, "hello", Method);
9+
void init(v8::Local<v8::Object> exports) {
10+
NODE_SET_METHOD(exports, "hello", Method);
1111
}
1212

1313
NODE_MODULE(binding, init);

0 commit comments

Comments
 (0)