Ignore:
Timestamp:
Aug 6, 2015, 9:24:38 AM (10 years ago)
Author:
[email protected]
Message:

Remove UnspecifiedBoolType from JSC
https://bugs.webkit.org/show_bug.cgi?id=147597

Patch by Keith Miller <[email protected]> on 2015-08-06
Reviewed by Mark Lam.

We were using the safe bool pattern in the code base for implicit casting to booleans.
With C++11 this is no longer necessary and we can instead create an operator bool.

  • API/JSRetainPtr.h:

(JSRetainPtr::operator bool):
(JSRetainPtr::operator UnspecifiedBoolType): Deleted.

  • dfg/DFGEdge.h:

(JSC::DFG::Edge::operator bool):
(JSC::DFG::Edge::operator UnspecifiedBoolType*): Deleted.

  • dfg/DFGIntegerRangeOptimizationPhase.cpp:
  • heap/Weak.h:
  • heap/WeakInlines.h:

(JSC::bool):
(JSC::UnspecifiedBoolType): Deleted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/WeakInlines.h

    r170774 r188040  
    100100}
    101101
    102 template<typename T> inline Weak<T>::operator UnspecifiedBoolType*() const
     102template<typename T> inline Weak<T>::operator bool() const
    103103{
    104     return reinterpret_cast<UnspecifiedBoolType*>(!!*this);
     104    return !!*this;
    105105}
    106106
Note: See TracChangeset for help on using the changeset viewer.