diff --git a/src/async_wrap.cc b/src/async_wrap.cc index 3f77169321a919..71599eecbda127 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -342,8 +342,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