v8.h | v8.h | |||
---|---|---|---|---|
skipping to change at line 302 | skipping to change at line 302 | |||
V8_INLINE(T* operator->() const) { return val_; } | V8_INLINE(T* operator->() const) { return val_; } | |||
V8_INLINE(T* operator*() const) { return val_; } | V8_INLINE(T* operator*() const) { return val_; } | |||
/** | /** | |||
* Checks whether two handles are the same. | * Checks whether two handles are the same. | |||
* Returns true if both are empty, or if the objects | * Returns true if both are empty, or if the objects | |||
* to which they refer are identical. | * to which they refer are identical. | |||
* The handles' references are not checked. | * 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** a = reinterpret_cast<internal::Object**>(**this); | |||
internal::Object** b = reinterpret_cast<internal::Object**>(*that); | internal::Object** b = reinterpret_cast<internal::Object**>(*that); | |||
if (a == 0) return b == 0; | if (a == 0) return b == 0; | |||
if (b == 0) return false; | if (b == 0) return false; | |||
return *a == *b; | return *a == *b; | |||
} | } | |||
#ifndef V8_USE_UNSAFE_HANDLES | #ifndef V8_USE_UNSAFE_HANDLES | |||
template <class S> V8_INLINE( | template <class S> V8_INLINE( | |||
bool operator==(const Persistent<S>& that) const) { | bool operator==(const Persistent<S>& that) const) { | |||
skipping to change at line 327 | skipping to change at line 327 | |||
return *a == *b; | return *a == *b; | |||
} | } | |||
#endif | #endif | |||
/** | /** | |||
* Checks whether two handles are different. | * Checks whether two handles are different. | |||
* Returns true if only one of the handles is empty, or if | * Returns true if only one of the handles is empty, or if | |||
* the objects to which they refer are different. | * the objects to which they refer are different. | |||
* The handles' references are not checked. | * 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); | 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)) { | template <class S> V8_INLINE(static Handle<T> Cast(Handle<S> that)) { | |||
#ifdef V8_ENABLE_CHECKS | #ifdef V8_ENABLE_CHECKS | |||
// If we're going to perform the type check then we have to check | // If we're going to perform the type check then we have to check | |||
// that the handle isn't empty before doing the checked cast. | // that the handle isn't empty before doing the checked cast. | |||
if (that.IsEmpty()) return Handle<T>(); | if (that.IsEmpty()) return Handle<T>(); | |||
#endif | #endif | |||
return Handle<T>(T::Cast(*that)); | return Handle<T>(T::Cast(*that)); | |||
} | } | |||
template <class S> V8_INLINE(Handle<S> As()) { | template <class S> V8_INLINE(Handle<S> As()) { | |||
skipping to change at line 614 | skipping to change at line 621 | |||
#ifndef V8_USE_UNSAFE_HANDLES | #ifndef V8_USE_UNSAFE_HANDLES | |||
template <class S> V8_INLINE( | template <class S> V8_INLINE( | |||
bool operator==(const Persistent<S>& that) const) { | bool operator==(const Persistent<S>& that) const) { | |||
internal::Object** a = reinterpret_cast<internal::Object**>(**this); | internal::Object** a = reinterpret_cast<internal::Object**>(**this); | |||
internal::Object** b = reinterpret_cast<internal::Object**>(*that); | internal::Object** b = reinterpret_cast<internal::Object**>(*that); | |||
if (a == 0) return b == 0; | if (a == 0) return b == 0; | |||
if (b == 0) return false; | if (b == 0) return false; | |||
return *a == *b; | 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** a = reinterpret_cast<internal::Object**>(**this); | |||
internal::Object** b = reinterpret_cast<internal::Object**>(*that); | internal::Object** b = reinterpret_cast<internal::Object**>(*that); | |||
if (a == 0) return b == 0; | if (a == 0) return b == 0; | |||
if (b == 0) return false; | if (b == 0) return false; | |||
return *a == *b; | 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 | #endif | |||
V8_INLINE(void Dispose()); | V8_INLINE(void Dispose()); | |||
/** | /** | |||
* Releases the storage cell referenced by this persistent handle. | * Releases the storage cell referenced by this persistent handle. | |||
* Does not remove the reference to the cell from any handles. | * Does not remove the reference to the cell from any handles. | |||
* This handle's reference, and any other references to the storage | * This handle's reference, and any other references to the storage | |||
* cell remain and IsEmpty will still return false. | * cell remain and IsEmpty will still return false. | |||
*/ | */ | |||
End of changes. 5 change blocks. | ||||
3 lines changed or deleted | 20 lines changed or added | |||