Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index 3252602bcf19d8fabba52e0c7fbbd274615f7ff2..b81645081e577a21685f0f4d1f61ffb124e5c61f 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -303,7 +303,7 @@ template <class T> class Handle { |
* to which they refer are identical. |
* The handles' references are not checked. |
*/ |
- template <class S> V8_INLINE(bool operator==(const Handle<S> that) const) { |
+ template <class S> V8_INLINE(bool operator==(const Handle<S>& that) const) { |
internal::Object** a = reinterpret_cast<internal::Object**>(**this); |
internal::Object** b = reinterpret_cast<internal::Object**>(*that); |
if (a == 0) return b == 0; |
@@ -328,10 +328,17 @@ template <class T> class Handle { |
* the objects to which they refer are different. |
* The handles' references are not checked. |
*/ |
- template <class S> V8_INLINE(bool operator!=(Handle<S> that) const) { |
+ template <class S> V8_INLINE(bool operator!=(const Handle<S>& that) const) { |
return !operator==(that); |
} |
+#ifndef V8_USE_UNSAFE_HANDLES |
+ template <class S> V8_INLINE( |
+ bool operator!=(const Persistent<S>& that) const) { |
+ return !operator==(that); |
+ } |
+#endif |
+ |
template <class S> V8_INLINE(static Handle<T> Cast(Handle<S> that)) { |
#ifdef V8_ENABLE_CHECKS |
// If we're going to perform the type check then we have to check |
@@ -618,13 +625,22 @@ template <class T> class Persistent // NOLINT |
return *a == *b; |
} |
- template <class S> V8_INLINE(bool operator==(const Handle<S> that) const) { |
+ template <class S> V8_INLINE(bool operator==(const Handle<S>& that) const) { |
internal::Object** a = reinterpret_cast<internal::Object**>(**this); |
internal::Object** b = reinterpret_cast<internal::Object**>(*that); |
if (a == 0) return b == 0; |
if (b == 0) return false; |
return *a == *b; |
} |
+ |
+ template <class S> V8_INLINE( |
+ bool operator!=(const Persistent<S>& that) const) { |
+ return !operator==(that); |
+ } |
+ |
+ template <class S> V8_INLINE(bool operator!=(const Handle<S>& that) const) { |
+ return !operator==(that); |
+ } |
#endif |
V8_INLINE(void Dispose()); |