async_hooks: use validateBoolean for trackPromises · nodejs/node@984260b · GitHub
Skip to content

Commit 984260b

Browse files
soulee-devaduh95
authored andcommitted
async_hooks: use validateBoolean for trackPromises
The `trackPromises` check duplicated `validateBoolean()` exactly: same error code, same expected type string, same argument order. Replace it with the validator, matching how this file already validates `type` and `fn` via `validateString()`/`validateFunction()`. `ERR_INVALID_ARG_TYPE` had no other use in this file, so drop the import. Since `validateBoolean` is wrapped in `hideStackFrames()`, the thrown error is unchanged from a caller's perspective. Signed-off-by: Soul Lee <alus20x@gmail.com> PR-URL: #64731 Refs: #61415 Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Aviv Keller <me@aviv.sh>
1 parent 06b54fe commit 984260b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/async_hooks.js

Lines changed: 3 additions & 3 deletions

0 commit comments

Comments
 (0)