Commit f2defcac authored by Daniel Bevenius's avatar Daniel Bevenius
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.

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 a27e6d73
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