/********************************************************************* * NAN - Native Abstractions for Node.js * * Copyright (c) 2016 NAN contributors * * MIT License ********************************************************************/ #ifndef NAN_PERSISTENT_12_INL_H_ #define NAN_PERSISTENT_12_INL_H_ template class Persistent : public v8::Persistent { public: NAN_INLINE Persistent() : v8::Persistent() {} template NAN_INLINE Persistent(v8::Local that) : v8::Persistent(v8::Isolate::GetCurrent(), that) {} template NAN_INLINE Persistent(const v8::Persistent &that) : v8::Persistent(v8::Isolate::GetCurrent(), that) {} NAN_INLINE void Reset() { v8::PersistentBase::Reset(); } template NAN_INLINE void Reset(const v8::Local &other) { v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); } template NAN_INLINE void Reset(const v8::PersistentBase &other) { v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); } template NAN_INLINE void SetWeak( P *parameter , typename WeakCallbackInfo

::Callback callback , WeakCallbackType type); private: NAN_INLINE T *operator*() const { return *PersistentBase::persistent; } template NAN_INLINE void Copy(const Persistent &that) { TYPE_CHECK(T, S); this->Reset(); if (!that.IsEmpty()) { this->Reset(that); M::Copy(that, this); } } }; #if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) template class Global : public v8::Global { public: NAN_INLINE Global() : v8::Global() {} template NAN_INLINE Global(v8::Local that) : v8::Global(v8::Isolate::GetCurrent(), that) {} template NAN_INLINE Global(const v8::PersistentBase &that) : v8::Global(v8::Isolate::GetCurrent(), that) {} NAN_INLINE void Reset() { v8::PersistentBase::Reset(); } template NAN_INLINE void Reset(const v8::Local &other) { v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); } template NAN_INLINE void Reset(const v8::PersistentBase &other) { v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); } template NAN_INLINE void SetWeak( P *parameter , typename WeakCallbackInfo

::Callback callback , WeakCallbackType type) { reinterpret_cast*>(this)->SetWeak( parameter, callback, type); } }; #else template class Global : public v8::UniquePersistent { public: NAN_INLINE Global() : v8::UniquePersistent() {} template NAN_INLINE Global(v8::Local that) : v8::UniquePersistent(v8::Isolate::GetCurrent(), that) {} template NAN_INLINE Global(const v8::PersistentBase &that) : v8::UniquePersistent(v8::Isolate::GetCurrent(), that) {} NAN_INLINE void Reset() { v8::PersistentBase::Reset(); } template NAN_INLINE void Reset(const v8::Local &other) { v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); } template NAN_INLINE void Reset(const v8::PersistentBase &other) { v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); } template NAN_INLINE void SetWeak( P *parameter , typename WeakCallbackInfo

::Callback callback , WeakCallbackType type) { reinterpret_cast*>(this)->SetWeak( parameter, callback, type); } }; #endif #endif // NAN_PERSISTENT_12_INL_H_