diff --git a/nan.h b/nan.h index 9338a699..9485ff7c 100644 --- a/nan.h +++ b/nan.h @@ -203,9 +203,21 @@ typedef v8::String::ExternalOneByteStringResource template class NonCopyablePersistentTraits : public v8::NonCopyablePersistentTraits {}; +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 10 || \ + (V8_MAJOR_VERSION == 10 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 5)) +template struct CopyablePersistentTraits { + typedef v8::Persistent > CopyablePersistent; + static const bool kResetInDestructor = true; + template + static NAN_INLINE void Copy(const v8::Persistent &source, + CopyablePersistent *dest) { + } +}; +#else template class CopyablePersistentTraits : public v8::CopyablePersistentTraits {}; +#endif template class PersistentBase :