chore: simplify WrappableBase::SecondWeakCallback (#29359)

This commit is contained in:
David Sanders 2021-05-27 13:15:25 -07:00 committed by GitHub
parent 9bb7051f54
commit d80e36bcdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,9 +74,7 @@ void WrappableBase::FirstWeakCallback(
// static
void WrappableBase::SecondWeakCallback(
const v8::WeakCallbackInfo<WrappableBase>& data) {
auto* wrappable = static_cast<WrappableBase*>(data.GetInternalField(0));
if (wrappable)
delete wrappable;
delete static_cast<WrappableBase*>(data.GetInternalField(0));
}
namespace internal {