Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src: handle failure during error wrap of primitive
When we wrap a primitive value into an object in order to throw it as an error, we call `napi_define_properties()` which may return `napi_pending_exception` if the environment is shutting down. Handle this case when `NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS` is given by checking whether we're in an environment shutdown scenario and ignore the failure of `napi_define_properties()`, since the error will not reach JS anyway. Signed-off-by: Gabriel Schulhof <gabrielschulhof@gmail.com> PR-URL: nodejs/node-addon-api#1310 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
- Loading branch information