diff --git a/src/async_wrap.cc b/src/async_wrap.cc index 5007fd34414abf..7b7930187bd530 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -25,9 +25,6 @@ #include "env-inl.h" #include "node_errors.h" #include "node_external_reference.h" -#ifdef DEBUG -#include -#endif #include "tracing/traced_value.h" #include "util-inl.h" @@ -677,13 +674,8 @@ MaybeLocal AsyncWrap::MakeCallback(const Local cb, Local* argv) { EmitTraceEventBefore(); -#ifdef DEBUG - if (context_frame().IsEmpty()) { - ProcessEmitWarning(env(), - "MakeCallback() called without context_frame, " - "likely use after destroy of AsyncWrap."); - } -#endif + // If this check fails it indicates an use after-free. + DCHECK(!context_frame().IsEmpty()); ProviderType provider = provider_type(); async_context context { get_async_id(), get_trigger_async_id() };