diff --git a/src/async_wrap.cc b/src/async_wrap.cc index bfbc8f222987d4..3b0727cdfbcf0a 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -365,8 +365,7 @@ static void PromiseHook(PromiseHookType type, Local promise, static void SetupHooks(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); - if (!args[0]->IsObject()) - return env->ThrowTypeError("first argument must be an object"); + CHECK(args[0]->IsObject()); // All of init, before, after, destroy are supplied by async_hooks // internally, so this should every only be called once. At which time all