From d8e57768bf63327816469dfbfe38a749e280c86a Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Thu, 20 Jun 2019 09:32:40 -0700 Subject: [PATCH] test: use Nan in duplicate_symbols Use `Nan::Set()` and `Nan::GetFunction()` instead of their V8 equivalents to avoid OSX test failures with Node.js v12.x. Thanks @rvagg! Re: https://github.com/nodejs/node-addon-api/pull/456 Fixes: https://github.com/nodejs/node/issues/26765 PR-URL: https://github.com/nodejs/node-gyp/pull/1689 Reviewed-By: Rod Vagg --- test/node_modules/duplicate_symbols/binding.cc | 6 +++--- test/node_modules/duplicate_symbols/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/node_modules/duplicate_symbols/binding.cc b/test/node_modules/duplicate_symbols/binding.cc index bc5f6f5134..a0999b76dc 100644 --- a/test/node_modules/duplicate_symbols/binding.cc +++ b/test/node_modules/duplicate_symbols/binding.cc @@ -2,9 +2,9 @@ #include "common.h" void Init(v8::Local exports) { - exports->Set(Nan::New("pointerCheck").ToLocalChecked(), - Nan::New(Something::PointerCheck) - ->GetFunction()); + Nan::Set(exports, Nan::New("pointerCheck").ToLocalChecked(), + Nan::GetFunction( + Nan::New(Something::PointerCheck)).ToLocalChecked()); } NODE_MODULE(NODE_GYP_MODULE_NAME, Init) diff --git a/test/node_modules/duplicate_symbols/package.json b/test/node_modules/duplicate_symbols/package.json index ee21161cf1..2a193f230f 100644 --- a/test/node_modules/duplicate_symbols/package.json +++ b/test/node_modules/duplicate_symbols/package.json @@ -6,7 +6,7 @@ "private": true, "dependencies": { "bindings": "~1.2.1", - "nan": "^2.0.0" + "nan": "^2.14.0" }, "scripts": { "test": "node index.js"