Skip to content

Commit 81c2b59

Browse files
committed
async_hooks: use CHECK instead of throwing error
SetupHooks is only available via `process.binding('async_wrap')`, so there's no reason it shouldn't be called with the appropriate arguments, since it is an internal-only function. The only place this function is used is `lib/internal/async_hooks.js`. PR-URL: #17832 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent c08f0d1 commit 81c2b59

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/async_wrap.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,7 @@ static void PromiseHook(PromiseHookType type, Local<Promise> promise,
343343
static void SetupHooks(const FunctionCallbackInfo<Value>& args) {
344344
Environment* env = Environment::GetCurrent(args);
345345

346-
if (!args[0]->IsObject())
347-
return env->ThrowTypeError("first argument must be an object");
346+
CHECK(args[0]->IsObject());
348347

349348
// All of init, before, after, destroy are supplied by async_hooks
350349
// internally, so this should every only be called once. At which time all

0 commit comments

Comments
 (0)