Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index dd8f2685bc37115638f5332ddbefd42a79c16cea..0ad85c51dc84637b2603bc47774b9f5634e62700 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -576,6 +576,7 @@ template <class T> class PersistentBase { |
template<class F> friend class UniquePersistent; |
template<class F> friend class PersistentBase; |
template<class F> friend class ReturnValue; |
+ friend class Object; |
explicit V8_INLINE PersistentBase(T* val) : val_(val) {} |
PersistentBase(PersistentBase& other); // NOLINT |
@@ -2185,6 +2186,12 @@ class V8_EXPORT Object : public Value { |
/** Gets the number of internal fields for this Object. */ |
int InternalFieldCount(); |
+ /** Same as above, but works for Persistents */ |
+ V8_INLINE static int InternalFieldCount( |
+ const PersistentBase<Object>& object) { |
+ return object.val_->InternalFieldCount(); |
+ } |
+ |
/** Gets the value from an internal field. */ |
V8_INLINE Local<Value> GetInternalField(int index); |
@@ -2198,6 +2205,12 @@ class V8_EXPORT Object : public Value { |
*/ |
V8_INLINE void* GetAlignedPointerFromInternalField(int index); |
+ /** Same as above, but works for Persistents */ |
+ V8_INLINE static void* GetAlignedPointerFromInternalField( |
+ const PersistentBase<Object>& object, int index) { |
+ return object.val_->GetAlignedPointerFromInternalField(index); |
+ } |
+ |
/** |
* Sets a 2-byte-aligned native pointer in an internal field. To retrieve such |
* a field, GetAlignedPointerFromInternalField must be used, everything else |