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

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: rebased 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 | test/cctest/test-api.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 b5c780afc0150e444eb423d5ad5f13ebcba092b1..993dfb91fb481d596bd03159c3f08e94e336feba 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(bool value));
V8_INLINE(void Set(double i));
@@ -5684,12 +5684,16 @@ 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) {
+ TYPE_CHECK(T, S);
*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) {
+ TYPE_CHECK(T, S);
*value_ = *reinterpret_cast<internal::Object**>(*handle);
}
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698