Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index c4a54a46ed712f3d41dedce76f7d42dcc75a8502..652f49e3f27fdfb6f2f9350fee4a98d92fa18208 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -404,6 +404,7 @@ template <class T> class Persistent : public Handle<T> { |
/** Returns true if this handle was previously marked as independent. */ |
inline bool IsIndependent() const; |
+ inline bool IsIndependent(Isolate* isolate) const; |
/** Checks if the handle holds the only reference to an object. */ |
inline bool IsNearDeath() const; |
@@ -3494,6 +3495,8 @@ class V8EXPORT V8 { |
static void ClearWeak(internal::Object** global_handle); |
static void MarkIndependent(internal::Object** global_handle); |
static bool IsGlobalIndependent(internal::Object** global_handle); |
+ static bool IsGlobalIndependent(internal::Isolate* isolate, |
+ internal::Object** global_handle); |
static bool IsGlobalNearDeath(internal::Object** global_handle); |
static bool IsGlobalWeak(internal::Object** global_handle); |
static void SetWrapperClassId(internal::Object** global_handle, |
@@ -4223,6 +4226,14 @@ bool Persistent<T>::IsIndependent() const { |
template <class T> |
+bool Persistent<T>::IsIndependent(Isolate* isolate) const { |
+ if (this->IsEmpty()) return false; |
+ return V8::IsGlobalIndependent(reinterpret_cast<internal::Isolate*>(isolate), |
+ reinterpret_cast<internal::Object**>(**this)); |
+} |
+ |
+ |
+template <class T> |
bool Persistent<T>::IsNearDeath() const { |
if (this->IsEmpty()) return false; |
return V8::IsGlobalNearDeath(reinterpret_cast<internal::Object**>(**this)); |