-
-
Notifications
You must be signed in to change notification settings - Fork 35.1k
Description
Is your feature request related to a problem? Please describe.
In the V8 API, arbitrary arguments are accessible via the instance method v8::FunctionCallbackInfo<T>::operator[](int i). But this doesn't appear exposed through the API, and this can be useful when writing native extensions.
Describe the solution you'd like
Something like napi_get_argument(napi_env, napi_callback_info, size_t, napi_value *result) that would be direct sugar over that. It would return napi_ok normally and napi_invalid_arg if the index is out of range.
Describe alternatives you've considered
I briefly considered the alternative of mallocing the arguments and returning them that way, but I felt it didn't mesh as well with the non-allocating nature of the rest of the API.