n-api: Retain last code when getting error info
Unlike most N-API functions, napi_get_last_error_info()
should not clear the last error code when successful, because a pointer to (not a copy of) the error info structure is returned via an out parameter.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
n-api