-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
napi_is_function #340
Comments
I just came across napi_valuetype type;
assert(napi_typeof(env, argv[0], &type) == napi_ok);
if (type != napi_function) {} |
@jorangreef yep, that's the way to ascertain whether a |
@jorangreef Check out |
Thanks @gabrielschulhof and @ralphtheninja |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have looked through all the documentation, but there doesn't seem to be a way to verify that a
napi_value
is a JS function, e.g. using something likenapi_is_function
?The reason for asking, is that I need to verify all user-supplied arguments (including a JS callback) and throw an exception before queuing async work.
The text was updated successfully, but these errors were encountered: