diff --git a/test/node_modules/hello_world/hello.cc b/test/node_modules/hello_world/hello.cc index 89bfd7ac04..ea724e896c 100644 --- a/test/node_modules/hello_world/hello.cc +++ b/test/node_modules/hello_world/hello.cc @@ -1,12 +1,11 @@ #include -void Method(const Nan::FunctionCallbackInfo& info) { +NAN_METHOD(Method) { info.GetReturnValue().Set(Nan::New("world").ToLocalChecked()); } -void Init(v8::Local exports) { - exports->Set(Nan::New("hello").ToLocalChecked(), - Nan::New(Method)->GetFunction()); +NAN_MODULE_INIT(Init) { + Nan::SetMethod(target, "hello", Method); } NODE_MODULE(hello, Init)