Commit 02ea033e authored by Daniel Bevenius's avatar Daniel Bevenius Committed by Myles Borins
Browse files

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: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarMatheus Marchini <matheus@sthima.com>
Reviewed-By: default avatarTiancheng "Timothy" Gu <timothygu99@gmail.com>
parent 68e78e8e
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment