summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/heap/Handle.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/heap/Handle.h')
-rw-r--r--Source/JavaScriptCore/heap/Handle.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/Source/JavaScriptCore/heap/Handle.h b/Source/JavaScriptCore/heap/Handle.h
index 28ac30cd9..ba4161c25 100644
--- a/Source/JavaScriptCore/heap/Handle.h
+++ b/Source/JavaScriptCore/heap/Handle.h
@@ -23,8 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef Handle_h
-#define Handle_h
+#pragma once
#include "HandleTypes.h"
@@ -52,9 +51,7 @@ class HandleBase {
public:
bool operator!() const { return !m_slot || !*m_slot; }
- // This conversion operator allows implicit conversion to bool but not to other integer types.
- typedef JSValue (HandleBase::*UnspecifiedBoolType);
- operator UnspecifiedBoolType*() const { return (m_slot && *m_slot) ? reinterpret_cast<UnspecifiedBoolType*>(1) : 0; }
+ explicit operator bool() const { return m_slot && *m_slot; }
HandleSlot slot() const { return m_slot; }
@@ -184,6 +181,4 @@ template <typename T, typename U> inline bool operator!=(JSValue a, const Handle
return a != b.get();
}
-}
-
-#endif
+} // namespace JSC