From f4a919c4b9580689cffdc68f4714dc1953a406df Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Mon, 1 Apr 2019 19:40:52 -0400 Subject: [PATCH] test: fix addon test for Node.js 12 and V8 7.4 V8 7.4 removes some API functions. Replace those with their NAN counterparts. --- test/node_modules/hello_world/hello.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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)