diff --git a/.github/workflows/ci-win.yml b/.github/workflows/ci-win.yml index 4b0ebfb23..4e48194c6 100644 --- a/.github/workflows/ci-win.yml +++ b/.github/workflows/ci-win.yml @@ -18,7 +18,6 @@ jobs: - standard - experimental node-version: - - 20.x - 22.x - 24.x - 25.x diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3813c3d62..30556fb8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,6 @@ jobs: - standard - experimental node-version: - - 20.x - 22.x - 24.x - 25.x diff --git a/napi-inl.h b/napi-inl.h index 9c0c47859..71de0ecd6 100644 --- a/napi-inl.h +++ b/napi-inl.h @@ -4771,7 +4771,7 @@ inline ClassPropertyDescriptor InstanceWrap::InstanceAccessor( napi_property_descriptor desc = napi_property_descriptor(); desc.utf8name = utf8name; desc.getter = details::TemplatedInstanceCallback; - desc.setter = This::WrapSetter(This::SetterTag()); + desc.setter = setter == nullptr ? nullptr : &This::WrappedMethod; desc.data = data; desc.attributes = attributes; return desc; @@ -4785,7 +4785,7 @@ inline ClassPropertyDescriptor InstanceWrap::InstanceAccessor( napi_property_descriptor desc = napi_property_descriptor(); desc.name = name; desc.getter = details::TemplatedInstanceCallback; - desc.setter = This::WrapSetter(This::SetterTag()); + desc.setter = setter == nullptr ? nullptr : &This::WrappedMethod; desc.data = data; desc.attributes = attributes; return desc; @@ -5204,7 +5204,7 @@ inline ClassPropertyDescriptor ObjectWrap::StaticAccessor( napi_property_descriptor desc = napi_property_descriptor(); desc.utf8name = utf8name; desc.getter = details::TemplatedCallback; - desc.setter = This::WrapStaticSetter(This::StaticSetterTag()); + desc.setter = setter == nullptr ? nullptr : &This::WrappedMethod; desc.data = data; desc.attributes = static_cast(attributes | napi_static); @@ -5219,7 +5219,7 @@ inline ClassPropertyDescriptor ObjectWrap::StaticAccessor( napi_property_descriptor desc = napi_property_descriptor(); desc.name = name; desc.getter = details::TemplatedCallback; - desc.setter = This::WrapStaticSetter(This::StaticSetterTag()); + desc.setter = setter == nullptr ? nullptr : &This::WrappedMethod; desc.data = data; desc.attributes = static_cast(attributes | napi_static); diff --git a/napi.h b/napi.h index 870a5c290..4f397cbe1 100644 --- a/napi.h +++ b/napi.h @@ -2468,17 +2468,6 @@ class InstanceWrap { template static napi_value WrappedMethod(napi_env env, napi_callback_info info) NAPI_NOEXCEPT; - - template - struct SetterTag {}; - - template - static napi_callback WrapSetter(SetterTag) NAPI_NOEXCEPT { - return &This::WrappedMethod; - } - static napi_callback WrapSetter(SetterTag) NAPI_NOEXCEPT { - return nullptr; - } }; /// Base class to be extended by C++ classes exposed to JavaScript; each C++ @@ -2645,18 +2634,6 @@ class ObjectWrap : public InstanceWrap, public Reference { static napi_value WrappedMethod(napi_env env, napi_callback_info info) NAPI_NOEXCEPT; - template - struct StaticSetterTag {}; - - template - static napi_callback WrapStaticSetter(StaticSetterTag) NAPI_NOEXCEPT { - return &This::WrappedMethod; - } - static napi_callback WrapStaticSetter(StaticSetterTag) - NAPI_NOEXCEPT { - return nullptr; - } - bool _construction_failed = true; bool _finalized = false; }; diff --git a/package.json b/package.json index f3d472a06..344f49a81 100644 --- a/package.json +++ b/package.json @@ -424,6 +424,7 @@ "eslint": "^9.13.0", "fs-extra": "^11.1.1", "neostandard": "^0.12.0", + "node-gyp": "^13.0.0", "pre-commit": "^1.2.2", "semver": "^7.6.0" }, @@ -475,6 +476,6 @@ "version": "8.9.0", "support": true, "engines": { - "node": "^18 || ^20 || >= 21" + "node": ">=22" } }