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 <[email protected]> PR-URL: #1310 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
- Loading branch information