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

Unified Diff: include/v8.h

Issue 16102002: Add template parameter to ReturnValue::Set. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 7 years, 7 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 | no next file » | 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 7dfc9189aa307198416f02c8f804c10d1653adbe..0cdb132a65a4d1eb38fab9f5d239e10859383e6f 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -2779,8 +2779,8 @@ class ReturnValue {
public:
V8_INLINE(explicit ReturnValue(internal::Object** slot));
// Handle setters
- V8_INLINE(void Set(const Persistent<T>& handle));
- V8_INLINE(void Set(const Handle<T> handle));
+ template <typename S> V8_INLINE(void Set(const Persistent<S>& handle));
+ template <typename S> V8_INLINE(void Set(const Handle<S> handle));
// Fast primitive setters
V8_INLINE(void Set(Isolate* isolate, bool value));
V8_INLINE(void Set(Isolate* isolate, double i));
@@ -5684,12 +5684,14 @@ template<typename T>
ReturnValue<T>::ReturnValue(internal::Object** slot) : value_(slot) {}
template<typename T>
-void ReturnValue<T>::Set(const Persistent<T>& handle) {
+template<typename S>
+void ReturnValue<T>::Set(const Persistent<S>& handle) {
dcarney 2013/05/27 12:34:36 you need the correct type check here and a test to
marja 2013/05/27 13:09:28 Done.
*value_ = *reinterpret_cast<internal::Object**>(*handle);
}
template<typename T>
-void ReturnValue<T>::Set(const Handle<T> handle) {
+template<typename S>
+void ReturnValue<T>::Set(const Handle<S> handle) {
*value_ = *reinterpret_cast<internal::Object**>(*handle);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698