Skip to content

Commit

Permalink
fix removal of v8::CopyablePersistent
Browse files Browse the repository at this point in the history
Readds the missing trait.
  • Loading branch information
kkoopa committed Jun 11, 2024
1 parent 56585a1 commit 5805ca5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions nan.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,21 @@ typedef v8::String::ExternalOneByteStringResource
template<typename T>
class NonCopyablePersistentTraits :
public v8::NonCopyablePersistentTraits<T> {};
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 10 || \
(V8_MAJOR_VERSION == 10 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 5))
template<typename T> struct CopyablePersistentTraits {
typedef v8::Persistent<T, CopyablePersistentTraits<T> > CopyablePersistent;
static const bool kResetInDestructor = true;
template <typename S, typename M>
static NAN_INLINE void Copy(const v8::Persistent<S, M> &source,
CopyablePersistent *dest) {
}
};
#else
template<typename T>
class CopyablePersistentTraits :
public v8::CopyablePersistentTraits<T> {};
#endif

template<typename T>
class PersistentBase :
Expand Down

0 comments on commit 5805ca5

Please sign in to comment.