Issue #1742 - Part 1: Refactor rooting base class templates

Based on Bug 1325406
This commit is contained in:
Moonchild 2022-05-24 06:51:11 +00:00 • committed by roytam1
commit 80d7d43961
24 changed files with 239 additions and 512 deletions

View file

@ -38,19 +38,12 @@ struct GCPolicy<RefPtr<T>>
} // namespace JS
namespace js {
template<typename T>
struct RootedBase<RefPtr<T>>
template<typename T, typename Wrapper>
struct WrappedPtrOperations<RefPtr<T>, Wrapper>
{
operator RefPtr<T>& () const
{
auto& self = *static_cast<const JS::Rooted<RefPtr<T>>*>(this);
return self.get();
}
operator T*() const
{
auto& self = *static_cast<const JS::Rooted<RefPtr<T>>*>(this);
return self.get();
return static_cast<const Wrapper*>(this)->get();
}
};
} // namespace js