File e31-nan-CopyablePersistentTraits.patch of Package code

From 5805ca5c4c2eef9a65316b68741e29f4825c511f Mon Sep 17 00:00:00 2001
From: Benjamin Byholm <bbyholm@abo.fi>
Date: Tue, 11 Jun 2024 23:20:35 +0300
Subject: [PATCH] fix removal of v8::CopyablePersistent

Readds the missing trait.
---
 nan.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/nan.h b/nan.h
index 9338a699..9485ff7c 100644
--- a/build/node_modules/nan/nan.h
+++ b/build/node_modules/nan/nan.h
@@ -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 :
openSUSE Build Service is sponsored by