mirror of https://github.com/nodejs/node.git
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 <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>pull/9183/head
parent
ef030da818
commit
09d41e22cc
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue