Changes
This commit is contained in:
25
node_modules/node-addon-api/napi-inl.h
generated
vendored
25
node_modules/node-addon-api/napi-inl.h
generated
vendored
@@ -137,7 +137,7 @@ struct FinalizeData {
|
||||
Hint* hint;
|
||||
};
|
||||
|
||||
#if (NAPI_VERSION > 3 && !defined(__wasm32__))
|
||||
#if (NAPI_VERSION > 3)
|
||||
template <typename ContextType=void,
|
||||
typename Finalizer=std::function<void(Env, void*, ContextType*)>,
|
||||
typename FinalizerDataType=void>
|
||||
@@ -196,7 +196,7 @@ struct ThreadSafeFinalize {
|
||||
FinalizerDataType* data;
|
||||
Finalizer callback;
|
||||
};
|
||||
#endif // NAPI_VERSION > 3 && !defined(__wasm32__)
|
||||
#endif
|
||||
|
||||
template <typename Getter, typename Setter>
|
||||
struct AccessorCallbackData {
|
||||
@@ -1740,14 +1740,8 @@ inline TypedArrayOf<T>::TypedArrayOf() : TypedArray(), _data(nullptr) {
|
||||
template <typename T>
|
||||
inline TypedArrayOf<T>::TypedArrayOf(napi_env env, napi_value value)
|
||||
: TypedArray(env, value), _data(nullptr) {
|
||||
napi_status status = napi_ok;
|
||||
if (value != nullptr) {
|
||||
status = napi_get_typedarray_info(
|
||||
_env, _value, &_type, &_length, reinterpret_cast<void**>(&_data), nullptr, nullptr);
|
||||
} else {
|
||||
_type = TypedArrayTypeForPrimitiveType<T>();
|
||||
_length = 0;
|
||||
}
|
||||
napi_status status = napi_get_typedarray_info(
|
||||
_env, _value, &_type, &_length, reinterpret_cast<void**>(&_data), nullptr, nullptr);
|
||||
NAPI_THROW_IF_FAILED_VOID(_env, status);
|
||||
}
|
||||
|
||||
@@ -3152,11 +3146,10 @@ inline ObjectWrap<T>::ObjectWrap(const Napi::CallbackInfo& callbackInfo) {
|
||||
napi_value wrapper = callbackInfo.This();
|
||||
napi_status status;
|
||||
napi_ref ref;
|
||||
T* instance = static_cast<T*>(this);
|
||||
status = napi_wrap(env, wrapper, instance, FinalizeCallback, nullptr, &ref);
|
||||
status = napi_wrap(env, wrapper, this, FinalizeCallback, nullptr, &ref);
|
||||
NAPI_THROW_IF_FAILED_VOID(env, status);
|
||||
|
||||
Reference<Object>* instanceRef = instance;
|
||||
Reference<Object>* instanceRef = this;
|
||||
*instanceRef = Reference<Object>(env, ref);
|
||||
}
|
||||
|
||||
@@ -3879,7 +3872,7 @@ inline napi_value ObjectWrap<T>::InstanceSetterCallbackWrapper(
|
||||
|
||||
template <typename T>
|
||||
inline void ObjectWrap<T>::FinalizeCallback(napi_env env, void* data, void* /*hint*/) {
|
||||
T* instance = static_cast<T*>(data);
|
||||
ObjectWrap<T>* instance = static_cast<ObjectWrap<T>*>(data);
|
||||
instance->Finalize(Napi::Env(env));
|
||||
delete instance;
|
||||
}
|
||||
@@ -4302,7 +4295,7 @@ inline void AsyncWorker::OnWorkComplete(Napi::Env /*env*/, napi_status status) {
|
||||
}
|
||||
}
|
||||
|
||||
#if (NAPI_VERSION > 3 && !defined(__wasm32__))
|
||||
#if (NAPI_VERSION > 3)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// ThreadSafeFunction class
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -4969,7 +4962,7 @@ template<class T>
|
||||
inline void AsyncProgressQueueWorker<T>::ExecutionProgress::Send(const T* data, size_t count) const {
|
||||
_worker->SendProgress_(data, count);
|
||||
}
|
||||
#endif // NAPI_VERSION > 3 && !defined(__wasm32__)
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Memory Management class
|
||||
|
||||
Reference in New Issue
Block a user