Skip to content

Commit 05a9543

Browse files
committed
fixup!
1 parent 5afa9bb commit 05a9543

3 files changed

Lines changed: 5 additions & 28 deletions

File tree

napi-inl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4771,7 +4771,7 @@ inline ClassPropertyDescriptor<T> InstanceWrap<T>::InstanceAccessor(
47714771
napi_property_descriptor desc = napi_property_descriptor();
47724772
desc.utf8name = utf8name;
47734773
desc.getter = details::TemplatedInstanceCallback<T, getter>;
4774-
desc.setter = This::WrapSetter(This::SetterTag<setter>());
4774+
desc.setter = setter == nullptr ? nullptr : &This::WrappedMethod<setter>;
47754775
desc.data = data;
47764776
desc.attributes = attributes;
47774777
return desc;
@@ -4785,7 +4785,7 @@ inline ClassPropertyDescriptor<T> InstanceWrap<T>::InstanceAccessor(
47854785
napi_property_descriptor desc = napi_property_descriptor();
47864786
desc.name = name;
47874787
desc.getter = details::TemplatedInstanceCallback<T, getter>;
4788-
desc.setter = This::WrapSetter(This::SetterTag<setter>());
4788+
desc.setter = setter == nullptr ? nullptr : &This::WrappedMethod<setter>;
47894789
desc.data = data;
47904790
desc.attributes = attributes;
47914791
return desc;
@@ -5204,7 +5204,7 @@ inline ClassPropertyDescriptor<T> ObjectWrap<T>::StaticAccessor(
52045204
napi_property_descriptor desc = napi_property_descriptor();
52055205
desc.utf8name = utf8name;
52065206
desc.getter = details::TemplatedCallback<getter>;
5207-
desc.setter = This::WrapStaticSetter(This::StaticSetterTag<setter>());
5207+
desc.setter = setter == nullptr ? nullptr : &This::WrappedMethod<setter>;
52085208
desc.data = data;
52095209
desc.attributes =
52105210
static_cast<napi_property_attributes>(attributes | napi_static);
@@ -5219,7 +5219,7 @@ inline ClassPropertyDescriptor<T> ObjectWrap<T>::StaticAccessor(
52195219
napi_property_descriptor desc = napi_property_descriptor();
52205220
desc.name = name;
52215221
desc.getter = details::TemplatedCallback<getter>;
5222-
desc.setter = This::WrapStaticSetter(This::StaticSetterTag<setter>());
5222+
desc.setter = setter == nullptr ? nullptr : &This::WrappedMethod<setter>;
52235223
desc.data = data;
52245224
desc.attributes =
52255225
static_cast<napi_property_attributes>(attributes | napi_static);

napi.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,17 +2468,6 @@ class InstanceWrap {
24682468
template <InstanceSetterCallback method>
24692469
static napi_value WrappedMethod(napi_env env,
24702470
napi_callback_info info) NAPI_NOEXCEPT;
2471-
2472-
template <InstanceSetterCallback setter>
2473-
struct SetterTag {};
2474-
2475-
template <InstanceSetterCallback setter>
2476-
static napi_callback WrapSetter(SetterTag<setter>) NAPI_NOEXCEPT {
2477-
return &This::WrappedMethod<setter>;
2478-
}
2479-
static napi_callback WrapSetter(SetterTag<nullptr>) NAPI_NOEXCEPT {
2480-
return nullptr;
2481-
}
24822471
};
24832472

24842473
/// Base class to be extended by C++ classes exposed to JavaScript; each C++
@@ -2645,18 +2634,6 @@ class ObjectWrap : public InstanceWrap<T>, public Reference<Object> {
26452634
static napi_value WrappedMethod(napi_env env,
26462635
napi_callback_info info) NAPI_NOEXCEPT;
26472636

2648-
template <StaticSetterCallback setter>
2649-
struct StaticSetterTag {};
2650-
2651-
template <StaticSetterCallback setter>
2652-
static napi_callback WrapStaticSetter(StaticSetterTag<setter>) NAPI_NOEXCEPT {
2653-
return &This::WrappedMethod<setter>;
2654-
}
2655-
static napi_callback WrapStaticSetter(StaticSetterTag<nullptr>)
2656-
NAPI_NOEXCEPT {
2657-
return nullptr;
2658-
}
2659-
26602637
bool _construction_failed = true;
26612638
bool _finalized = false;
26622639
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@
424424
"eslint": "^9.13.0",
425425
"fs-extra": "^11.1.1",
426426
"neostandard": "^0.12.0",
427-
"node-gyp": "^12.4.0",
427+
"node-gyp": "^13.0.0",
428428
"pre-commit": "^1.2.2",
429429
"semver": "^7.6.0"
430430
},

0 commit comments

Comments
 (0)