update for node 21 (#1794)

Co-authored-by: mwilsnd <mwilsnd@gmail.com>
This commit is contained in:
Andrew Calcutt
2023-10-23 11:06:58 -04:00
committed by GitHub
parent da45706601
commit ae2c90719e
5 changed files with 55 additions and 24 deletions

View File

@@ -6,7 +6,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/cmake/module.cmake)
add_node_module(
mbgl-node
INSTALL_PATH ${PROJECT_SOURCE_DIR}/lib/{node_abi}/mbgl.node
NAN_VERSION 2.17.0
NAN_VERSION 2.18.0
EXCLUDE_NODE_ABIS
46
47

View File

@@ -9,7 +9,7 @@ if [[ "${CIRCLE_TAG}" == "node-v${PACKAGE_JSON_VERSION}" ]] || [[ "${PUBLISH:-}"
# Changes to the version targets here should happen in tandem with updates to the
# EXCLUDE_NODE_ABIS property in cmake/node.cmake and the "node" engines property in
# package.json.
for TARGET in 14.0.0 16.0.0 18.0.0; do
for TARGET in 16.0.0 18.0.0 20.0.0; do
rm -rf build/stage
if [[ "${BUILDTYPE}" == "RelWithDebInfo" ]]; then

View File

@@ -53,7 +53,10 @@ void NodeRequest::New(const Nan::FunctionCallbackInfo<v8::Value>& info) {
Nan::Set(info.This(), Nan::New("kind").ToLocalChecked(), info[4]);
v8::Local<v8::Value> argv[] = {info.This()};
request->asyncResource->runInAsyncScope(
Nan::To<v8::Object>(target->handle()->GetInternalField(1)).ToLocalChecked(), "request", 1, argv);
Nan::To<v8::Object>(target->handle()->GetInternalField(1).As<v8::Value>()).ToLocalChecked(),
"request",
1,
argv);
info.GetReturnValue().Set(info.This());
}