src: fix error message in async_hooks constructor
There are two minor issues in the AsyncHook constructor, if the object passed in has an after and/or destroy property that are not functions the errors thrown will still be: TypeError [ERR_ASYNC_CALLBACK]: before must be a function This commit updates the code and adds a unit test. Backport-PR-URL: https://github.com/nodejs/node/pull/22380 PR-URL: https://github.com/nodejs/node/pull/19000 Reviewed-By:Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Matheus Marchini <matheus@sthima.com> Reviewed-By:
Tiancheng "Timothy" Gu <timothygu99@gmail.com>
parent
68e78e8e
Please register or sign in to comment