Skip to content

Commit

Permalink
node-api: add missing initialization of last error
Browse files Browse the repository at this point in the history
- Add missing initiatlization of last error which
  was reported by coverity.

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

PR-URL: #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>
  • Loading branch information
mhdawson authored and targos committed Jan 14, 2022
1 parent e808ee6 commit 5fe011a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/js_native_api_v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit 5fe011a

Please sign in to comment.