node-api: add missing initialization of last error

- Add missing initiatlization of last error which
  was reported by coverity.

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/41290
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
This commit is contained in:
Michael Dawson authored and Danielle Adams committed 2022-01-31 23:54:36 -05:00
1 parent 874000ff6b
commit 03490cb311
1 file changed
+1
+1
View File
@@ -56,6 +56,7 @@ struct napi_env__ {
: isolate(context->GetIsolate()),
context_persistent(isolate, context) {
CHECK_EQ(isolate, context->GetIsolate());
napi_clear_last_error(this);
}
virtual ~napi_env__() {
// First we must finalize those references that have `napi_finalizer`