From 5fb19f5f104938ecd3ec5d993763927f94cdffdf Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Tue, 2 Apr 2019 19:42:13 +0100 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. PR-URL: https://github.com/nodejs/node-gyp/pull/1705 Reviewed-By: Refael Ackermann Reviewed-By: Ben Noordhuis --- 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)