Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index a5ef0543b5579cf87a5cba52f37bbe82c161bc16..68569a513e203e7c8b75c36e5ede2b8d45a872c7 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -5104,8 +5104,14 @@ class VisitorAdapter : public i::ObjectVisitor { |
UNREACHABLE(); |
} |
virtual void VisitEmbedderReference(i::Object** p, uint16_t class_id) { |
+#ifdef V8_USE_OLD_STYLE_PERSISTENT_HANDLE_VISITORS |
visitor_->VisitPersistentHandle(ToApi<Value>(i::Handle<i::Object>(p)), |
class_id); |
+#else |
+ Value* value = ToApi<Value>(i::Handle<i::Object>(p)); |
+ visitor_->VisitPersistentHandle( |
+ reinterpret_cast<Persistent<Value>*>(&value), class_id); |
+#endif |
} |
private: |
PersistentHandleVisitor* visitor_; |