Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index 3a86e86e020cbc9448c50f2ccd21476035a66c2e..ba70a33d9739161e09f973afc1be657bce60f7c8 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -695,6 +695,8 @@ template <class T> class Persistent // NOLINT |
*/ |
V8_INLINE(void Reset(Isolate* isolate, const Handle<T>& other)); |
+ V8_INLINE(T* LeakPersistent()); |
Sven Panne
2013/05/10 12:00:02
Please add a comment that it is necessary to re-wr
marja
2013/05/10 13:02:26
Done.
|
+ |
#ifndef V8_USE_UNSAFE_HANDLES |
#ifndef V8_ALLOW_ACCESS_TO_PERSISTENT_IMPLICIT |
@@ -5384,6 +5386,7 @@ void Persistent<T>::SetWrapperClassId(uint16_t class_id) { |
SetWrapperClassId(Isolate::GetCurrent(), class_id); |
} |
+ |
template <class T> |
void Persistent<T>::Reset(Isolate* isolate, const Handle<T>& other) { |
Dispose(isolate); |
@@ -5400,6 +5403,21 @@ void Persistent<T>::Reset(Isolate* isolate, const Handle<T>& other) { |
#endif |
} |
+ |
+template <class T> |
+T* Persistent<T>::LeakPersistent() { |
Sven Panne
2013/05/10 12:00:02
As discussed offline, we should better name it "Cl
marja
2013/05/10 13:02:26
Done.
|
+ T* old; |
+#ifdef V8_USE_UNSAFE_HANDLES |
+ old = this->operator*(); |
Sven Panne
2013/05/10 12:00:02
Can we use '*this' here? If not, a comment might b
marja
2013/05/10 13:02:26
"this" is not Persistent, but Persistent*, so "*th
|
+ *this = Persistent<T>(); |
+#else |
+ old = val_; |
+ val_ = NULL; |
+#endif |
+ return old; |
+} |
+ |
+ |
template <class T> |
void Persistent<T>::SetWrapperClassId(Isolate* isolate, uint16_t class_id) { |
typedef internal::Internals I; |