Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(655)

Unified Diff: include/v8.h

Issue 1237603003: Add convenience method for converting v8::PersistentBase to v8::Local (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed test compilation Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/test-global-handles.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 6e1db3a581f5c7ce340e3a9f6d9b4a45f06c6cff..560bfb4d00370d5edaf2ab34c4e4e8e8a7369ebf 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -509,6 +509,10 @@ template <class T> class PersistentBase {
V8_INLINE bool IsEmpty() const { return val_ == NULL; }
V8_INLINE void Empty() { val_ = 0; }
+ V8_INLINE Local<T> Get(Isolate* isolate) const {
+ return Local<T>::New(isolate, *this);
+ }
+
template <class S>
V8_INLINE bool operator==(const PersistentBase<S>& that) const {
internal::Object** a = reinterpret_cast<internal::Object**>(this->val_);
« no previous file with comments | « no previous file | test/cctest/test-global-handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698